/* ==================== MODERN AUTH MODAL ==================== */

/* Modal Overlay */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex !important;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal Container */
.auth-modal-container {
    position: relative;
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 520px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    color: #666;
    font-size: 18px;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg);
}

/* Auth Content */
.auth-modal-content {
    padding: 40px 35px 35px;
}

/* Auth Message */
.auth-message {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab:hover {
    color: #0A4B3E;
}

.auth-tab.active {
    background: white;
    color: #0A4B3E;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeInForm 0.3s ease;
}

@keyframes fadeInForm {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Google Button */
.google-btn {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e8e8e8;
    background: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.google-btn:hover {
    border-color: #0A4B3E;
    background: rgba(10, 75, 62, 0.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.google-btn svg {
    flex-shrink: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    color: #999;
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e8e8;
}

.divider span {
    padding: 0 16px;
}

/* Modern Form */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 2px solid #e8e8e8 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    color: #333 !important;
    background: white !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box;
}

.input-wrapper input:focus {
    outline: none !important;
    border-color: #0A4B3E !important;
    box-shadow: 0 0 0 4px rgba(10, 75, 62, 0.08) !important;
}

.input-wrapper input::placeholder {
    color: #bbb !important;
}

/* Password field: right padding for toggle eye button */
.input-wrapper input[type="password"] {
    padding-right: 44px !important;
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 6px;
    transition: color 0.3s ease;
    z-index: 2;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #0A4B3E;
}

.password-hint {
    font-size: 12px;
    color: #999;
    margin-top: -4px;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0A4B3E;
}

.forgot-password,
.link {
    font-size: 14px;
    color: #0A4B3E;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover,
.link:hover {
    color: #096354;
    text-decoration: underline;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0A4B3E 0%, #096354 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(10, 75, 62, 0.3);
    margin-top: 6px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #096354 0%, #0A4B3E 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 75, 62, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit i {
    transition: transform 0.3s ease;
}

.btn-submit:hover i {
    transform: translateX(4px);
}

/* Loading State */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 576px) {
    .auth-modal-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 20px;
    }
    
    .auth-modal-content {
        padding: 35px 20px 25px;
    }
    
    .auth-title {
        font-size: 1.4rem;
    }
    
    .close-modal {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
    }
    
    .google-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Scrollbar Styling */
.auth-modal-container::-webkit-scrollbar {
    width: 8px;
}

.auth-modal-container::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.auth-modal-container::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

.auth-modal-container::-webkit-scrollbar-thumb:hover {
    background: #0A4B3E;
}

/* Message Toast Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.auth-message {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

/* ==================== TERMS & CONDITIONS MODAL ==================== */
.terms-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 200000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.terms-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.terms-modal-box {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 680px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.terms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.terms-modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-modal-header h2 i {
    color: #c9a96e;
    font-size: 1.2rem;
}

.terms-modal-close {
    background: none;
    border: none;
    font-size: 26px;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.terms-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.terms-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    font-size: 14px;
    line-height: 1.75;
    color: #444;
}

.terms-modal-body h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 22px 0 8px;
}

.terms-modal-body h2:first-child {
    margin-top: 0;
}

.terms-modal-body p {
    margin: 0 0 10px;
}

.terms-modal-body ul,
.terms-modal-body ol {
    padding-left: 20px;
    margin: 8px 0 12px;
}

.terms-modal-body ul li,
.terms-modal-body ol li {
    margin-bottom: 5px;
}

.terms-modal-body a {
    color: #0A4B3E;
    text-decoration: underline;
}

.terms-modal-footer {
    display: flex;
    gap: 12px;
    padding: 18px 28px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    justify-content: flex-end;
}

.terms-accept-btn {
    padding: 11px 28px;
    background: linear-gradient(135deg, #0A4B3E 0%, #096354 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(10, 75, 62, 0.25);
}

.terms-accept-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(10, 75, 62, 0.35);
}

.terms-decline-btn {
    padding: 11px 22px;
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.terms-decline-btn:hover {
    background: #e0e0e0;
}

/* Loading spinner inside terms modal */
.terms-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    gap: 14px;
}

.terms-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: #c9a96e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Scrollbar in terms body */
.terms-modal-body::-webkit-scrollbar { width: 6px; }
.terms-modal-body::-webkit-scrollbar-track { background: #f8f9fa; }
.terms-modal-body::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 3px; }
.terms-modal-body::-webkit-scrollbar-thumb:hover { background: #c9a96e; }

@media (max-width: 576px) {
    .terms-modal-box {
        max-height: 92vh;
        border-radius: 16px;
    }
    .terms-modal-header,
    .terms-modal-body,
    .terms-modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }
    .terms-modal-footer {
        flex-direction: column-reverse;
    }
    .terms-accept-btn,
    .terms-decline-btn {
        width: 100%;
        justify-content: center;
    }
}
