/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Body & Background === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f0ec;
    background-image: radial-gradient(circle at 50% 50%, rgba(var(--color-primary-rgb), 0.03) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Card === */
.auth-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 44px 40px 40px;
    max-width: 390px;
    width: 100%;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 24px 48px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

/* === Card Shine (linha decorativa topo) === */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    opacity: 0.8;
    border-radius: 20px 20px 0 0;
}

/* === Logo === */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.logo-image {
    max-width: 180px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #111111;
    letter-spacing: -0.01em;
}

/* === Typography === */
.auth-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111111;
    margin-bottom: 8px;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 13.5px;
    color: #888888;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* === Field Label === */
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 8px;
}

/* === Input Wrap === */
.input-wrap {
    position: relative;
    margin-bottom: 20px;
}

.input-container {
    position: relative;
    display: block;
}

.input-wrap .input-icon {
    pointer-events: none;
}

.input-wrap .auth-input {
    position: relative;
    z-index: 0;
}

/* === Input Icon === */
.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #999999;
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
}

/* === Input === */
.auth-input {
    width: 100%;
    background: #f7f7f5;
    border: 1.5px solid #e8e8e4;
    border-radius: 50px;
    padding: 13px 48px 13px 46px;
    font-size: 14px;
    color: #222222;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input::placeholder {
    color: #bbbbbb;
}

.auth-input:focus {
    border-color: var(--color-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.10);
    color: #111111;
}

.auth-input:focus + .eye-toggle,
.auth-input:focus ~ .input-icon {
    color: #666666;
    opacity: 1;
}

.auth-input.error {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.03);
}

/* === Eye Button === */
.eye-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 6px;
    font-size: 15px;
    transition: color 0.2s ease;
    z-index: 2;
    opacity: 0.8;
}

.eye-toggle:hover {
    color: #666666;
    opacity: 1;
}

/* === Error Message === */
.error-message {
    display: block;
    font-size: 12px;
    color: var(--color-primary);
    margin-top: 6px;
    margin-left: 16px;
}

/* === Remember / Forgot Row === */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* === Custom Radio Checkbox === */
.remember-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-radio {
    position: relative;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.custom-radio input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.radio-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #d0d0cc;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s ease;
    pointer-events: none;
}

.custom-radio input[type="checkbox"]:checked ~ .radio-dot {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.custom-radio input[type="checkbox"]:checked ~ .radio-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
}

.remember-label {
    font-size: 13px;
    color: #777777;
    cursor: pointer;
    user-select: none;
}

/* === Forgot Link === */
.forgot-link {
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.forgot-link:hover {
    opacity: 0.8;
}

/* === Submit Button === */
.auth-submit {
    width: 100%;
    background: var(--color-primary);
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 18px rgba(var(--color-primary-rgb), 0.28);
    font-family: 'Inter', sans-serif;
    margin-bottom: 24px;
}

.auth-submit:hover {
    opacity: 0.93;
    box-shadow: 0 6px 24px rgba(var(--color-primary-rgb), 0.36);
}

.auth-submit:active {
    transform: scale(0.98);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === Footer === */
.auth-footer {
    text-align: center;
    font-size: 13px;
    color: #999999;
}

.auth-footer-link {
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.auth-footer-link:hover {
    opacity: 0.8;
}

/* === 2FA Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 15, 20, 0.85);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 380px;
    width: 100%;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 32px 64px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111111;
    margin-bottom: 8px;
}

.modal-description {
    font-size: 13.5px;
    color: #888888;
    margin-bottom: 28px;
    line-height: 1.5;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

.modal-cancel {
    background: none;
    border: none;
    color: #999999;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.modal-cancel:hover {
    color: #666666;
}

/* === Loading State === */
.auth-submit.loading {
    position: relative;
    color: transparent;
}

.auth-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* === Responsive === */
@media (max-width: 480px) {
    .auth-card {
        padding: 36px 28px 32px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-subtitle {
        font-size: 13px;
    }
    
    .modal-card {
        padding: 32px 24px;
    }
}

/* === Utility === */
.hidden {
    display: none !important;
}


/* === Code Inputs (2FA) === */
.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.code-box {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #111111;
    background: #f7f7f5;
    border: 2px solid #e8e8e4;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    caret-color: var(--color-primary);
}

.code-box:focus {
    border-color: var(--color-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.10);
}

.code-box.filled {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.05);
}

.code-box.error {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.05);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}
