/* ==========================================================================
   Estilos del Login - App-V2 SaaS
   ========================================================================== */

:root {
    --primary-color: #efb810;
    --primary-hover: #d4a20b;
    --bg-dark: #121319;
    --card-bg: #1c1e26;
    --card-border: #2e3240;
    --text-primary: #ffffff;
    --text-muted: #9a9eb0;
    --input-bg: #14161d;
    --input-border: #2a2e3d;
    --input-focus: #efb810;
    --error-bg: #381a1d;
    --error-border: #e63946;
    --error-text: #ff858d;
    --success-bg: #132a1e;
    --success-border: #2a9d8f;
    --success-text: #70e0d0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top right, #1f2230 0%, var(--bg-dark) 60%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 36px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.brand-logo img {
    max-width: 200px;
    max-height: 70px;
    object-fit: contain;
}

.brand-logo i {
    font-size: 28px;
}

.login-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Alertas */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.alert-success {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

/* Formulario */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select.form-control-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group select.form-control-select option {
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(239, 184, 16, 0.15);
}

.input-password-wrapper {
    position: relative;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    padding: 4px;
}

.btn-toggle-password:hover {
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 12px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    color: var(--text-muted);
}

.checkbox-container input {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--primary-color);
    color: #121319;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.99);
}

.btn-secondary-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}

.btn-secondary-link:hover {
    color: var(--text-primary);
}

.mfa-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(239, 184, 16, 0.05);
    border: 1px solid rgba(239, 184, 16, 0.2);
    border-radius: 8px;
}

.mfa-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.mfa-info p {
    font-size: 13px;
    margin-bottom: 6px;
}

.mfa-info small {
    color: var(--text-muted);
}

/* Selección de Método de Envío MFA */
.mfa-methods-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.mfa-methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-mfa-method {
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-mfa-method.active {
    border-color: var(--primary-color);
    background: rgba(239, 184, 16, 0.12);
    color: var(--primary-color);
}

.btn-mfa-method:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: rgba(239, 184, 16, 0.18);
}

.btn-mfa-method:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--input-border);
}

.mfa-timer-box {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.mfa-timer-box.ready {
    color: var(--success-text);
    background: rgba(42, 157, 143, 0.1);
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   Selección de Estudio: Checkbox "Recordar" y Tarjeta de Estudio Recordado
   ========================================================================== */
.form-group-checkbox {
    margin-bottom: 24px;
}

.checkbox-inline-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12.5px !important;
    color: var(--text-muted);
    margin-bottom: 0 !important;
}

.checkbox-inline-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.remembered-studio-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.remembered-studio-card:hover {
    border-color: var(--primary-color);
    background: rgba(239, 184, 16, 0.08);
}

.remembered-studio-logo {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--card-bg);
}

.remembered-studio-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.remembered-studio-label {
    font-size: 11px;
    color: var(--text-muted);
}

.remembered-studio-name {
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-forget-studio {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    flex-shrink: 0;
}

.btn-forget-studio:hover {
    color: var(--error-text);
}

.use-another-studio-link {
    text-align: center;
    font-size: 12.5px;
    margin-bottom: 20px;
}

.use-another-studio-link a {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

/* ==========================================================================
   Reglas de Fortaleza de Contraseña (Restablecimiento / Contraseña Vencida)
   ========================================================================== */
.password-rules-box {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.password-rules-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 12px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
    color: var(--text-muted);
}

.rule-item.invalid {
    color: var(--error-text);
}

.rule-item.valid {
    color: var(--success-text);
    font-weight: 600;
}

.password-strength-bar-container {
    width: 100%;
    height: 8px;
    background: var(--card-border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 14px;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.use-another-studio-link a:hover {
    text-decoration: underline;
}
