/* Auth & Form Styles */
.auth-container {
    width: 100%;
    max-width: 450px;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease-out;
    font-family: 'Poppins', sans-serif; /* Ensure Poppins is used */
}

.auth-header {
    margin-bottom: 30px;
    text-align: left; /* Aligned properly to the left */
}

.auth-header h2 {
    color: var(--text-dark);
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.auth-header p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.form-control.error {
    border-color: #dc2626;
    background-color: #fef2f2; /* Light red background for input */
}

/* Custom Error Alert Box */
.error-alert {
    background-color: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #dc2626;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    display: none; /* Hidden by default */
    animation: fadeIn 0.3s ease-out;
}

.error-alert.show {
    display: flex;
}

.error-alert i {
    font-size: 16px;
}

.error-message {
    /* Deprecated in favor of .error-alert, but kept for inline if needed */
    color: #dc2626;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* Account Type Selector */
.account-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 10px;
}

.type-option {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
}

.type-option.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 20, 60, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 15px;
    overflow: hidden;
    transform: translateY(20px);
    transition: 0.3s;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-footer p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

/* Privacy Modal — Themed */
.privacy-modal {
    max-width: 640px;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 40, 100, 0.25);
    font-family: 'Poppins', sans-serif;
}

.privacy-header {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: #fff;
    text-align: center;
    padding: 14px 20px 12px;
    border-bottom: none;
}

.privacy-header-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    vertical-align: middle;
    color: #fff;
}

.privacy-header-icon svg {
    width: 20px;
    height: 20px;
}

.privacy-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: inline;
    vertical-align: middle;
    letter-spacing: -0.2px;
}

.privacy-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.75;
    margin: 4px 0 0;
}

.privacy-body {
    max-height: 420px;
    padding: 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    line-height: 1.75;
    color: #334155;
    scrollbar-width: thin;
    scrollbar-color: #0056b3 #e2e8f0;
}

.privacy-body::-webkit-scrollbar {
    width: 6px;
}

.privacy-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.privacy-body::-webkit-scrollbar-thumb {
    background: #0056b3;
    border-radius: 3px;
}

.privacy-intro {
    font-size: 13px;
    color: #475569;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
}

.privacy-section {
    margin-bottom: 20px;
}

.privacy-section h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #0056b3;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    min-width: 26px;
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
}

.privacy-section p {
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}

.privacy-section ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.privacy-section ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #475569;
}

.privacy-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 7px;
    height: 7px;
    background: #0056b3;
    border-radius: 50%;
    opacity: 0.6;
}

.contact-card {
    background: #f0f5ff;
    border-left: 3px solid #0056b3;
    padding: 14px 16px;
    border-radius: 0 10px 10px 0;
    font-size: 13px;
    color: #334155;
    margin-top: 10px;
    line-height: 1.8;
}

.contact-placeholder {
    color: #94a3b8;
    font-style: italic;
}

.consent-section {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
}

.consent-section h4 {
    color: #0056b3;
}

.privacy-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.privacy-actions {
    display: flex;
    gap: 10px;
}

.privacy-btn-decline {
    font-family: 'Poppins', sans-serif;
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.privacy-btn-decline:hover {
    background: #b91c1c;
}

.privacy-btn-agree {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.25);
}

.privacy-btn-agree:hover:not(:disabled) {
    background: linear-gradient(135deg, #004494 0%, #003370 100%);
}

.privacy-btn-agree:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* Reset generic .btn styles from styles.css inside auth contexts */
.auth-container .btn {
    flex-direction: row;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
}

/* Buttons */
.btn-block {
    width: 100%;
}

.btn-primary {
    background: #0056b3; /* Blue for Proceed/Agree */
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif; /* Explicitly use Poppins */
}

.btn-primary:hover {
    background: #004494; /* Darker Blue */
    transform: none; /* Explicitly disable the lift effect from global styles */
    box-shadow: none; /* Optional: adjust if you want to keep shadow */
}

.btn-primary:active {
    background: #003366; /* Even Darker Blue */
}

.btn-primary:disabled {
    background: #93c5fd;
    transform: none;
    box-shadow: none;
}

.btn-danger, .btn-secondary {
    background: #dc2626; /* Red for Cancel/Decline */
    color: white;
    border: none;
}

.btn-danger:hover, .btn-secondary:hover {
    background: #b91c1c;
    color: white;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading Dots */
.loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.loading-dots::before,
.loading-dots::after,
.loading-dots span {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: dotPulse 1.2s ease-in-out infinite;
}

.loading-dots::before {
    animation-delay: 0s;
}

.loading-dots span {
    animation-delay: 0.2s;
}

.loading-dots::after {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .auth-container {
        max-width: 100%;
        padding: 24px 20px;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .auth-header h2 {
        font-size: 20px;
    }

    .auth-header p {
        font-size: 13px;
    }

    .form-control {
        font-size: 14px;
        padding: 10px 14px;
    }

    .account-type-selector {
        gap: 8px;
    }

    .type-option {
        font-size: 13px;
        padding: 8px;
    }

    /* Privacy modal responsive */
    .privacy-modal {
        max-width: 95%;
        margin: 10px;
    }

    .privacy-body {
        max-height: 55vh;
        padding: 16px;
    }

    .privacy-header {
        padding: 12px 16px 10px;
    }

    .privacy-header h3 {
        font-size: 14px;
    }

    .privacy-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .privacy-actions {
        width: 100%;
    }

    .privacy-btn-decline,
    .privacy-btn-agree {
        flex: 1;
        text-align: center;
        padding: 10px 16px;
    }

    .scroll-hint {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .auth-container {
        padding: 20px 16px;
    }

    .auth-header h2 {
        font-size: 18px;
    }

    .form-label {
        font-size: 13px;
    }

    .privacy-section h4 {
        font-size: 13px;
    }

    .section-number {
        width: 22px;
        height: 22px;
        min-width: 22px;
        font-size: 11px;
    }
}
