/* login.css — Estilos da página de login via código */

:root {
    --primary: #003087;
    --primary-light: #0047cc;
    --secondary: #b71c1c;
    --bg: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.97);
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --border: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #001f5c 0%, #0f172a 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-wrapper {
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 45px 35px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
    text-align: center;
}
.brand-logo {
    max-height: 75px;
    width: auto;
    margin-bottom: 14px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}
.brand-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.brand-sub {
    font-size: 11px;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.brand-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 99px;
    margin: 0 auto 10px;
}
.stage-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.stage-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.stage-panel {
    display: none;
    animation: slideIn 0.35s ease-out;
}
.stage-panel.active {
    display: block;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 7px;
    letter-spacing: 0.5px;
}
.form-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid var(--border);
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    background: #fff;
    color: var(--text);
    outline: none;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 48, 135, 0.08);
}
.btn-primary {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 16px rgba(0, 48, 135, 0.2);
    letter-spacing: 0.5px;
}
.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 48, 135, 0.3);
}
.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-outline {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    text-align: center;
}
.btn-outline:hover {
    background: rgba(0, 48, 135, 0.05);
    border-color: var(--primary-light);
    color: var(--primary-light);
}
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    margin-top: 12px;
    transition: color 0.2s ease;
    text-decoration: none;
}
.btn-back:hover { color: var(--primary); }
.btn-back:focus-visible,
.login-inline-action:focus-visible { outline: 3px solid rgba(0, 48, 135, 0.2); outline-offset: 3px; }
.login-inline-action {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}
.login-inline-action:hover { color: var(--primary-light); text-decoration: underline; }
.back-link {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}
.back-link a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.back-link a:hover { color: var(--primary); }
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.45;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fde68a; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.debug-badge {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 16px;
}
.debug-badge.visible { display: flex; }
.debug-badge svg { flex-shrink: 0; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-hidden { display: none !important; }

/* Stage 2: Channel selection */
.client-greeting {
    background: #f0f4ff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 14px;
    border: 1px solid #dbe4ff;
}
.client-greeting.visible {
    display: flex;
}
.client-avatar {
    width: 44px; height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.client-avatar svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}
.client-info-line { font-size: 14px; color: var(--text); font-weight: 600; }
.client-info-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.channel-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0;
    border: 0;
    min-width: 0;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.channel-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
}
.channel-card > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.channel-card:hover {
    border-color: var(--primary-light);
    background: #fafbff;
}
.channel-card:has(input:checked),
.channel-card.is-selected {
    border-color: var(--primary);
    background: #f0f4ff;
    box-shadow: 0 0 0 4px rgba(0, 48, 135, 0.06);
}
.channel-card:has(input:disabled),
.channel-card.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.channel-card:has(input:focus-visible) {
    outline: 3px solid rgba(0, 48, 135, 0.22);
    outline-offset: 3px;
}
.channel-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
}
.channel-icon.email { background: #e0f2fe; }
.channel-icon.whatsapp { background: #dcfce7; }
.channel-details { display: block; flex: 1; }
.channel-name { display: block; font-size: 15px; font-weight: 700; color: var(--text); }
.channel-dest { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.channel-check {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.channel-card:has(input:checked) .channel-check,
.channel-card.is-selected .channel-check {
    background: var(--primary);
    border-color: var(--primary);
}
.channel-card:has(input:checked) .channel-check::after,
.channel-card.is-selected .channel-check::after {
    content: '';
    width: 6px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Stage 3: Code entry */
.code-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.code-input-group input {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid var(--border);
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    text-align: center;
    letter-spacing: 6px;
    font-weight: 700;
    background: #fff;
    color: var(--text);
    outline: none;
    text-transform: uppercase;
    transition: border-color 0.2s ease;
}
.code-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 48, 135, 0.08);
}
.code-sent-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}
.code-sent-info strong { color: var(--text); }
.btn-resend {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: #fff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}
.btn-resend:hover { background: #f0f4ff; border-color: var(--primary-light); }
.btn-resend:disabled { opacity: 0.5; cursor: not-allowed; }
.attempts-counter {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 12px;
}
.attempts-counter.warning { color: var(--danger); font-weight: 600; }
.spinner-inline {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: -3px;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
footer {
    text-align: center;
    margin-top: 22px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}
