@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-blue: #00a3ff;
    --primary-blue-dark: #0077bb;
    --bg-body: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.95);
    --input-bg: rgba(13, 17, 23, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --success-green: #3fb950;
    --error-red: #f85149;
    --warning-orange: #d29922;
    --accent-glow: rgba(0, 163, 255, 0.2);
    --glass-border: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #161b22, #0d1117);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ── */
.gov-header {
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.gov-header .brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.gov-header .brand i {
    color: var(--primary-blue);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* ── MAIN CONTAINER ── */
.main-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    width: 100%;
    max-width: 580px;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
}

.card-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.5px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* ── FORMS ── */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    height: 18px; /* Força altura constante */
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.btn-text:hover {
    opacity: 1;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

input {
    width: 100%;
    height: 48px;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px var(--accent-glow);
    background: rgba(13, 17, 23, 1);
}

input:focus + i {
    color: var(--primary-blue);
}

/* Fix for browser autofill background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important;
    -webkit-box-shadow: 0 0 0px 1000px #0d1117 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── STRENGTH METER ── */
.strength-meter {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    margin: 1rem 0;
    border-radius: 3px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.4s ease, background-color 0.4s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.checklist {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
}

.check-item {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.check-item.valid {
    color: var(--success-green);
}

/* ── BUTTONS ── */
.btn {
    width: 100%;
    height: 52px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 163, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: #33b5ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 163, 255, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #334155;
}

/* ── OTP BOXES ── */
.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 2rem 0;
}

.otp-box {
    width: 50px;
    height: 64px;
    padding: 0; /* Reset inherited padding */
    text-align: center;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.75rem;
    color: white;
    transition: all 0.2s ease;
}

.otp-box:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 15px var(--accent-glow);
}

.otp-box.complete {
    border-color: var(--success-green);
    color: var(--success-green);
}

/* ── ALERTS ── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    gap: 12px;
    border-left: 4px solid transparent;
}

.alert-error {
    background: rgba(248, 81, 73, 0.1);
    color: #ff7b72;
    border-color: var(--error-red);
}

.alert-info {
    background: rgba(56, 139, 253, 0.1);
    color: #79c0ff;
    border-color: var(--primary-blue);
}

/* ── STEPPER ── */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: var(--border-color);
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    background: var(--bg-body);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.4s ease;
}

.step.active .step-circle {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.step-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--primary-blue);
}

/* ── FOOTER ── */
.gov-footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--glass-border);
}

/* ── SECURITY ALERTS ── */
.security-alert {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--error-red);
    color: #ff7b72;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: none;
    align-items: center;
    gap: 10px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.4s ease;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── RESPONSIVE DESIGN (MOBILE) ── */
@media (max-width: 768px) {
    .gov-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 8px;
    }

    .gov-header .brand {
        font-size: 1rem;
    }

    .main-wrapper {
        padding: 1rem;
        align-items: flex-start;
    }

    .card {
        padding: 1.5rem;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row > .form-group {
        margin-bottom: 1.25rem;
    }

    .checklist {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .otp-container {
        gap: 6px;
    }

    .otp-box {
        width: 40px;
        height: 52px;
        font-size: 1.25rem;
    }

    .stepper::before {
        top: 12px;
    }

    .step-circle {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .step-label {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .otp-box {
        width: 36px;
        height: 48px;
        font-size: 1.2rem;
    }
}
