/**
 * Account System Styles
 * Matches /hotel/promotion-ihg.php design
 * Purple theme (#8b5cf6)
 * Modern white + purple accents
 */

/* =====================================================
   HIDE SMART MENU FOR ACCOUNT PAGES
   ===================================================== */
.smart-menu,
.menu-bar,
nav.menu-bar,
nav.smart-menu,
.menu-overlay,
.smart-menu-overlay,
.mobile-menu-overlay {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    z-index: -9999 !important;
}

/* Ensure no smart menu animations or transitions */
* [class*="smart-menu"],
* [class*="menu-bar"] {
    display: none !important;
    visibility: hidden !important;
}

/* Fix hamburger menu - ensure it works with static header only */
.header-container .menu-toggle,
.header-container .hamburger-menu {
    display: block !important;
}

/* Ensure static header menu is visible on mobile */
@media (max-width: 767px) {
    .header-container .nav-links {
        display: none;
    }

    .header-container .nav-links.active {
        display: flex !important;
        flex-direction: column;
    }
}

/* =====================================================
   ACCOUNT HEADER (Legacy - No longer used)
   ===================================================== */
.account-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.account-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 30px;
    margin-left: auto;
    margin-right: 30px;
}

.main-nav a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: #8b5cf6;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.user-link:hover {
    background: #f3f4f6;
    color: #8b5cf6;
}

.user-link i {
    font-size: 20px;
}

.login-btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #374151;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-panel.active {
    opacity: 1;
}

.mobile-menu-panel.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: white;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #374151;
    cursor: pointer;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-menu-nav a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.mobile-menu-nav a:hover {
    background: #f3f4f6;
}

.mobile-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 10px 0;
}

/* =====================================================
   AUTH CONTAINER
   ===================================================== */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.auth-screen {
    display: none;
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.3s;
}

.auth-screen.active {
    display: block;
}

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

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
    text-align: center;
}

.auth-description {
    color: #6b7280;
    text-align: center;
    margin-bottom: 30px;
    font-size: 15px;
}

/* Resend OTP Countdown */
.resend-countdown {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.resend-countdown i {
    font-size: 16px;
    color: #f59e0b;
}

.resend-countdown strong {
    color: #b45309;
    font-weight: 700;
}

/* =====================================================
   FORMS
   ===================================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

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

.form-group input[type="email"],
.form-group input[type="text"]:not(.otp-digit),
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:not(.otp-digit):focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Validated input - purple border when filled and validated */
.form-group input.input-validated {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2) !important;
}

.form-group small {
    color: #6b7280;
    font-size: 13px;
}

/* OTP Input Group - 6 separate digit fields */
.otp-input-group {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.otp-digit {
    width: 50px !important;
    min-width: 50px;
    max-width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    color: #1f2937;
    background: #ffffff;
    padding: 0 !important;
    flex-shrink: 0;
}

.otp-digit:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    transform: scale(1.05);
}

.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* OTP Reference Display - Read-only display */
.otp-reference-display {
    width: 100%;
    max-width: 250px;
    margin: 15px auto;
    padding: 20px 30px;
    background: linear-gradient(135deg, #f3f0ff 0%, #ede9fe 100%);
    border: 3px solid #8b5cf6;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.otp-reference-display #otp-reference-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #8b5cf6;
    letter-spacing: 12px;
    font-family: monospace;
    text-transform: uppercase;
    user-select: none;
}

/* Legacy OTP Reference Input (if needed for forgot-password) */
.otp-reference-input {
    width: 100% !important;
    max-width: 200px;
    text-align: center;
    font-size: 24px !important;
    letter-spacing: 8px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 15px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 8px !important;
    background: #ffffff;
    transition: all 0.2s;
    font-family: monospace;
}

.otp-reference-input:focus {
    outline: none;
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
    transform: scale(1.02);
}

.otp-reference-input::placeholder {
    letter-spacing: 8px;
    color: #d1d5db;
    text-transform: none;
}

/* Legacy single OTP input (kept for backwards compatibility) */
.otp-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 10px;
    font-weight: 600;
}

/* =====================================================
   PASSWORD INPUT & STRENGTH BAR
   ===================================================== */

.password-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.password-strength-container {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.password-strength-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.password-strength-fill.strength-weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-fill.strength-medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-fill.strength-strong {
    width: 100%;
    background: #10b981;
}

.password-strength-text {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.password-strength-text.strength-weak {
    color: #ef4444;
}

.password-strength-text.strength-medium {
    color: #f59e0b;
}

.password-strength-text.strength-strong {
    color: #10b981;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    width: 100% !important;
    padding-right: 45px !important; /* Make room for toggle button */
    box-sizing: border-box !important;
}

.password-toggle {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    padding: 8px !important;
    font-size: 18px !important;
    z-index: 10 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    outline: none !important;
    box-shadow: none !important;
}

.password-toggle:hover {
    color: #8b5cf6 !important;
}

.password-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    font-weight: 400;
    margin: 0;
    cursor: pointer;
}

.checkbox-group a {
    color: #8b5cf6;
    text-decoration: none;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
    padding: 14px 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-full {
    width: 100%;
}

/* Button loading state */
.btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-spinner i {
    animation: spin 1s linear infinite;
}

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

.auth-footer {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-top: 10px;
}

.auth-footer a {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   MESSAGES & ALERTS
   ===================================================== */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.message.active {
    display: block;
    animation: slideDown 0.3s;
}

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

.message.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.text-success {
    color: #10b981;
    font-weight: 500;
}

.text-error {
    color: #ef4444;
    font-weight: 500;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* =====================================================
   RESPONSIVE - MOBILE
   ===================================================== */
@media (max-width: 767px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-menu-panel {
        display: block;
    }

    .user-section .login-btn {
        display: none;
    }

    .user-section .user-link {
        padding: 6px 12px;
        font-size: 14px;
    }

    .auth-card {
        padding: 30px 20px;
    }

    .auth-card h1 {
        font-size: 24px;
    }

    .auth-container {
        padding: 40px 15px;
    }

    /* OTP Digit fields - smaller on mobile but still in one row */
    .otp-input-group {
        display: flex;
        flex-direction: row;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .otp-digit {
        width: 42px !important;
        min-width: 42px;
        max-width: 42px;
        height: 52px;
        font-size: 20px;
        flex-shrink: 0;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .account-header-container {
        padding: 0 30px;
    }

    .main-nav {
        gap: 20px;
        margin-right: 20px;
    }
}
