/**
 * Kangra Hub - Premium Auth UI Styles
 * Modern, SaaS-grade authentication experience
 * 
 * Features:
 * - Premium glassmorphism design
 * - Smooth animations & transitions
 * - Clear hover states with glow effects
 * - Fully responsive
 * - Brand-consistent styling
 */

/* ============================================
   CSS CUSTOM PROPERTIES FOR AUTH
   ============================================ */
:root {
    --auth-primary: #00AEEF;
    --auth-primary-dark: #0095CC;
    --auth-primary-light: #5BC8F5;
    --auth-accent: #EE5A9D;
    --auth-gradient: linear-gradient(135deg, #00AEEF 0%, #0095CC 50%, #007AAD 100%);
    --auth-gradient-hover: linear-gradient(135deg, #0095CC 0%, #007AAD 50%, #006699 100%);
    --auth-glow: 0 0 20px rgba(0, 174, 239, 0.4);
    --auth-glow-strong: 0 0 30px rgba(0, 174, 239, 0.6);
    --auth-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --auth-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.2);
    --auth-radius: 14px;
    --auth-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   NAVBAR AUTH BUTTONS - PREMIUM STYLE
   ============================================ */

/* Login Button - Primary CTA with Glow */
.auth-login-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    background: var(--auth-gradient);
    color: #fff !important;
    border: none;
    border-radius: var(--auth-radius);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--auth-transition);
    box-shadow: 0 4px 15px rgba(0, 174, 239, 0.35);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on login button */
.auth-login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-login-btn:hover::before {
    left: 100%;
}

.auth-login-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--auth-glow), var(--auth-shadow-hover);
    background: var(--auth-gradient-hover);
}

.auth-login-btn:active {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 2px 10px rgba(0, 174, 239, 0.4);
}

.auth-login-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.3), var(--auth-glow);
}

.auth-login-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.auth-login-btn:hover i {
    transform: translateX(2px);
}

/* Signup Button - Always Visible with Solid Background */
.auth-signup-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.35rem;
    /* SOLID BACKGROUND - Always visible */
    background: #ffffff;
    color: #0095CC !important;
    border: 2px solid #00AEEF;
    border-radius: var(--auth-radius);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--auth-transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    /* Visible shadow for depth */
    box-shadow: 0 2px 8px rgba(0, 174, 239, 0.15);
}

/* Hover enhancement - fills with gradient */
.auth-signup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--auth-gradient);
    z-index: -1;
    transition: width 0.35s ease;
}

.auth-signup-btn:hover::before {
    width: 100%;
}

.auth-signup-btn:hover {
    color: #fff !important;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 174, 239, 0.35);
}

.auth-signup-btn:active {
    transform: translateY(-1px);
}

.auth-signup-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.25);
}

.auth-signup-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.auth-signup-btn:hover i {
    transform: scale(1.1);
}


/* Nav Auth Container */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    position: relative;
    z-index: 1001;
}

/* ============================================
   SCROLLED NAVBAR - AUTH ELEMENTS
   When navbar is scrolled (light background),
   update auth elements for proper visibility
   ============================================ */

/* Profile trigger text in scrolled state */
.navbar.scrolled .auth-profile-trigger {
    background: var(--bg-card, #fff);
    border-color: var(--border-color, #e5e7eb);
    color: #1a202c !important;
}

.navbar.scrolled .auth-profile-trigger .user-name {
    color: #1a202c !important;
}

.navbar.scrolled .auth-profile-trigger .fa-chevron-down {
    color: #6b7280 !important;
}

.navbar.scrolled .auth-profile-trigger:hover {
    border-color: var(--auth-primary);
    box-shadow: 0 4px 16px rgba(0, 174, 239, 0.15);
    color: #00AEEF !important;
}

.navbar.scrolled .auth-profile-trigger:hover .user-name {
    color: #00AEEF !important;
}

.navbar.scrolled .auth-profile-trigger:hover .fa-chevron-down {
    color: #00AEEF !important;
}

/* Auth buttons on scrolled navbar - ensure proper contrast */
.navbar.scrolled .auth-login-btn {
    background: var(--auth-gradient);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 174, 239, 0.35);
}

.navbar.scrolled .auth-login-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--auth-glow), var(--auth-shadow-hover);
}

.navbar.scrolled .auth-signup-btn {
    background: #ffffff;
    color: #0095CC !important;
    border: 2px solid #00AEEF;
}

.navbar.scrolled .auth-signup-btn:hover {
    color: #fff !important;
    background: var(--auth-gradient);
    border-color: transparent;
}

/* ============================================
   DASHBOARD SPECIFIC NAVBAR - REMOVED
   Now uses standard navbar.scrolled class via JS detection
   of pages without hero sections (data-no-hero attribute)
   ============================================ */


/* ============================================
   VISIBILITY STATES
   ============================================ */
.auth-guest-only {
    display: inline-flex !important;
}

.auth-user-only {
    display: none !important;
}

body.user-logged-in .auth-guest-only {
    display: none !important;
}

body.user-logged-in .auth-user-only {
    display: flex !important;
}

/* ============================================
   PROFILE DROPDOWN - PREMIUM DESIGN
   ============================================ */
.auth-profile-dropdown {
    position: relative;
}

.auth-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.9rem;
    background: var(--bg-card, #fff);
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
    transition: var(--auth-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-profile-trigger:hover {
    border-color: var(--auth-primary);
    box-shadow: 0 4px 16px rgba(0, 174, 239, 0.15);
    transform: translateY(-1px);
}

.auth-profile-trigger:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.2);
}

/* User Avatar in Dropdown */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--auth-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 174, 239, 0.3);
    transition: var(--auth-transition);
}

.auth-profile-trigger:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: var(--auth-glow);
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.auth-profile-trigger .fa-chevron-down {
    font-size: 0.7rem;
    color: var(--gray-400, #9ca3af);
    transition: transform 0.3s ease;
}

.auth-profile-dropdown.open .auth-profile-trigger .fa-chevron-down {
    transform: rotate(180deg);
}

/* Profile Menu */
.auth-profile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1002;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.auth-profile-dropdown.open .auth-profile-menu {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: dropdownSlideIn 0.3s ease;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-profile-menu a,
.auth-profile-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary, #374151);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: var(--auth-transition);
}

.auth-profile-menu a i,
.auth-profile-menu button i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.auth-profile-menu a:hover,
.auth-profile-menu button:hover {
    background: linear-gradient(90deg, rgba(0, 174, 239, 0.08) 0%, transparent 100%);
    color: var(--auth-primary);
}

.auth-profile-menu a:hover i,
.auth-profile-menu button:hover i {
    transform: translateX(3px);
    color: var(--auth-primary);
}

.auth-profile-menu .auth-logout-btn {
    color: #ef4444 !important;
    border-top: 1px solid var(--border-color, #e5e7eb);
    margin-top: 0;
    padding: 14px 18px;
    background: transparent;
}

.auth-profile-menu .auth-logout-btn:hover {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, transparent 100%);
    color: #dc2626 !important;
}

.auth-profile-menu hr {
    margin: 0;
    border: none;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

/* ============================================
   MOBILE DRAWER AUTH - PREMIUM STYLE
   ============================================ */
.mobile-drawer {
    display: flex;
    flex-direction: column;
}

.mobile-drawer .auth-login-btn,
.mobile-drawer .auth-signup-btn {
    display: flex !important;
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.mobile-drawer .auth-login-btn {
    background: var(--auth-gradient);
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 174, 239, 0.4);
}

.mobile-drawer .auth-login-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--auth-glow-strong);
}

.mobile-drawer .auth-signup-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.mobile-drawer .auth-signup-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
}

.mobile-drawer .auth-logout-btn {
    display: flex !important;
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--auth-transition);
}

.mobile-drawer .auth-logout-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
    transform: scale(1.02);
}

.mobile-drawer .auth-user-only {
    display: none !important;
}

body.user-logged-in .mobile-drawer .auth-user-only {
    display: flex !important;
}

body.user-logged-in .mobile-drawer .auth-guest-only {
    display: none !important;
}

/* Drawer Footer Fixed */
.mobile-drawer .drawer-footer {
    margin-top: auto;
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    padding-top: 1.5rem;
}

/* ============================================
   NETLIFY IDENTITY WIDGET - ULTRA PREMIUM OVERRIDE
   SaaS-Grade Glassmorphism Authentication Modal
   ============================================ */

/* Premium Color Palette for Modal */
:root {
    --modal-primary: #6366f1;
    --modal-primary-dark: #4f46e5;
    --modal-primary-light: #818cf8;
    --modal-accent: #ec4899;
    --modal-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --modal-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
    --modal-glow: 0 0 40px rgba(99, 102, 241, 0.4);
    --modal-glow-strong: 0 0 60px rgba(99, 102, 241, 0.6);
    --modal-glass: rgba(255, 255, 255, 0.85);
    --modal-glass-dark: rgba(15, 23, 42, 0.95);
}

/* Base Widget Font */
.netlify-identity-widget {
    font-family: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* ===== BACKDROP - Frosted Glass Effect ===== */
.netlify-identity-widget .modalWrapper {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    animation: modalBackdropIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes modalBackdropIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

/* ===== MODAL CONTAINER - Premium Glassmorphism ===== */
.netlify-identity-widget .modal {
    background: var(--modal-glass) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 28px !important;
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 -1px 0 rgba(255, 255, 255, 0.5) inset,
        0 0 100px rgba(99, 102, 241, 0.15) !important;
    animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    overflow: hidden !important;
    max-width: 440px !important;
    width: 94% !important;
    position: relative !important;
}

/* Subtle animated gradient border */
.netlify-identity-widget .modal::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, #6366f1, #ec4899, #8b5cf6, #6366f1) !important;
    background-size: 300% 100% !important;
    animation: gradientFlow 4s ease infinite !important;
}

@keyframes gradientFlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== MODAL HEADER - Gradient with Mesh Pattern ===== */
.netlify-identity-widget .modalHeader {
    background: var(--modal-gradient) !important;
    padding: 2rem 2rem 1.75rem !important;
    border-bottom: none !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Animated mesh gradient overlay */
.netlify-identity-widget .modalHeader::before {
    content: '' !important;
    position: absolute !important;
    top: -100% !important;
    left: -50% !important;
    width: 200% !important;
    height: 300% !important;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.2) 0%, transparent 40%) !important;
    animation: meshFloat 8s ease-in-out infinite !important;
    pointer-events: none !important;
}

@keyframes meshFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(10px, -10px) rotate(2deg);
    }

    66% {
        transform: translate(-5px, 5px) rotate(-1deg);
    }
}

/* Floating particles effect */
.netlify-identity-widget .modalHeader::after {
    content: '' !important;
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 60% 30%, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.25) 1px, transparent 1px) !important;
    background-size: 50px 50px, 70px 70px, 60px 60px !important;
    animation: particlesDrift 20s linear infinite !important;
    pointer-events: none !important;
}

@keyframes particlesDrift {
    from {
        background-position: 0 0, 0 0, 0 0;
    }

    to {
        background-position: 50px 50px, 70px 70px, 60px 60px;
    }
}

.netlify-identity-widget .modalHeader h1,
.netlify-identity-widget .modalHeader .header {
    color: #fff !important;
    font-size: 1.65rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    position: relative !important;
    z-index: 2 !important;
    margin: 0 !important;
}

/* ===== CLOSE BUTTON - Minimal Floating Style ===== */
.netlify-identity-widget .btn-close,
.netlify-identity-widget .modalClose {
    position: absolute !important;
    top: 1.25rem !important;
    right: 1.25rem !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    font-size: 1.25rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    z-index: 10 !important;
}

.netlify-identity-widget .btn-close:hover,
.netlify-identity-widget .modalClose:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

.netlify-identity-widget .btn-close:active,
.netlify-identity-widget .modalClose:active {
    transform: rotate(90deg) scale(0.95) !important;
}

/* ===== TAB BUTTONS - Animated Segmented Control ===== */
.netlify-identity-widget .tabs,
.netlify-identity-widget [role="tablist"] {
    display: flex !important;
    background: rgba(99, 102, 241, 0.08) !important;
    border-radius: 16px !important;
    padding: 6px !important;
    margin: 0 2rem 1.5rem !important;
    position: relative !important;
    gap: 4px !important;
}

.netlify-identity-widget .tab,
.netlify-identity-widget [role="tab"] {
    flex: 1 !important;
    padding: 0.9rem 1.5rem !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    background: transparent !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: relative !important;
    z-index: 1 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.netlify-identity-widget .tab:hover,
.netlify-identity-widget [role="tab"]:hover {
    color: var(--modal-primary) !important;
}

.netlify-identity-widget .tab.active,
.netlify-identity-widget .tab[aria-selected="true"],
.netlify-identity-widget [role="tab"][aria-selected="true"] {
    color: #fff !important;
    background: var(--modal-gradient) !important;
    box-shadow:
        0 4px 15px rgba(99, 102, 241, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
    transform: scale(1.02) !important;
}

.netlify-identity-widget .tab.active:hover,
.netlify-identity-widget .tab[aria-selected="true"]:hover {
    transform: scale(1.04) !important;
}

/* ===== MODAL BODY ===== */
.netlify-identity-widget .modalBody {
    padding: 0.5rem 2rem 2rem !important;
    background: transparent !important;
}

/* ===== FORM GROUPS ===== */
.netlify-identity-widget .formGroup {
    margin-bottom: 1.5rem !important;
    position: relative !important;
}

/* ===== LABELS - Elegant Style ===== */
.netlify-identity-widget label {
    display: block !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    margin-bottom: 0.6rem !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    transition: color 0.3s ease !important;
}

.netlify-identity-widget .formGroup:focus-within label {
    color: var(--modal-primary) !important;
}

/* ===== INPUT FIELDS - Premium Neumorphic Style ===== */
.netlify-identity-widget input[type="text"],
.netlify-identity-widget input[type="email"],
.netlify-identity-widget input[type="password"] {
    width: 100% !important;
    padding: 1rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    background: #f8fafc !important;
    border: 2px solid transparent !important;
    border-radius: 14px !important;
    box-shadow:
        inset 2px 2px 6px rgba(0, 0, 0, 0.06),
        inset -2px -2px 6px rgba(255, 255, 255, 0.8),
        0 0 0 0 rgba(99, 102, 241, 0) !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    outline: none !important;
}

.netlify-identity-widget input[type="text"]:hover,
.netlify-identity-widget input[type="email"]:hover,
.netlify-identity-widget input[type="password"]:hover {
    background: #fff !important;
    box-shadow:
        inset 1px 1px 4px rgba(0, 0, 0, 0.04),
        inset -1px -1px 4px rgba(255, 255, 255, 0.9),
        0 4px 12px rgba(99, 102, 241, 0.08) !important;
}

.netlify-identity-widget input[type="text"]:focus,
.netlify-identity-widget input[type="email"]:focus,
.netlify-identity-widget input[type="password"]:focus {
    background: #fff !important;
    border-color: var(--modal-primary) !important;
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.15),
        0 4px 20px rgba(99, 102, 241, 0.12),
        inset 0 0 0 rgba(0, 0, 0, 0) !important;
    transform: translateY(-2px) !important;
}

/* Autofill Fix - Remove ugly yellow background */
.netlify-identity-widget input:-webkit-autofill,
.netlify-identity-widget input:-webkit-autofill:hover,
.netlify-identity-widget input:-webkit-autofill:focus {
    -webkit-box-shadow:
        0 0 0 50px #fff inset,
        0 0 0 4px rgba(99, 102, 241, 0.15) !important;
    -webkit-text-fill-color: #1e293b !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

/* ===== PRIMARY BUTTON - Premium Gradient with Ripple ===== */
.netlify-identity-widget .btn-primary,
.netlify-identity-widget button[type="submit"] {
    width: 100% !important;
    padding: 1.1rem 2rem !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: #fff !important;
    background: var(--modal-gradient) !important;
    border: none !important;
    border-radius: 14px !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    margin-top: 0.5rem !important;
    box-shadow:
        0 6px 25px rgba(99, 102, 241, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    z-index: 1 !important;
}

/* Shimmer effect */
.netlify-identity-widget .btn-primary::before,
.netlify-identity-widget button[type="submit"]::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent) !important;
    transition: left 0.6s ease !important;
    z-index: -1 !important;
}

.netlify-identity-widget .btn-primary:hover::before,
.netlify-identity-widget button[type="submit"]:hover::before {
    left: 100% !important;
}

.netlify-identity-widget .btn-primary:hover,
.netlify-identity-widget button[type="submit"]:hover {
    transform: translateY(-4px) scale(1.02) !important;
    background: var(--modal-gradient-hover) !important;
    box-shadow:
        var(--modal-glow-strong),
        0 12px 35px rgba(99, 102, 241, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
}

.netlify-identity-widget .btn-primary:active,
.netlify-identity-widget button[type="submit"]:active {
    transform: translateY(-1px) scale(0.98) !important;
    box-shadow:
        0 4px 15px rgba(99, 102, 241, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
}

/* Disabled State */
.netlify-identity-widget .btn-primary:disabled,
.netlify-identity-widget button[type="submit"]:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #cbd5e1 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7 !important;
}

/* ===== FORGOT PASSWORD / LINKS - Elegant Underline ===== */
.netlify-identity-widget .btn-link,
.netlify-identity-widget .footer a,
.netlify-identity-widget a {
    color: var(--modal-primary) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
}

.netlify-identity-widget .btn-link::after,
.netlify-identity-widget .footer a::after {
    content: '' !important;
    position: absolute !important;
    bottom: -3px !important;
    left: 50% !important;
    width: 0 !important;
    height: 2px !important;
    background: var(--modal-gradient) !important;
    border-radius: 2px !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    transform: translateX(-50%) !important;
}

.netlify-identity-widget .btn-link:hover::after,
.netlify-identity-widget .footer a:hover::after {
    width: 100% !important;
}

.netlify-identity-widget .btn-link:hover,
.netlify-identity-widget .footer a:hover,
.netlify-identity-widget a:hover {
    color: var(--modal-primary-dark) !important;
}

/* ===== ERROR STATES - Animated Shake ===== */
.netlify-identity-widget .error,
.netlify-identity-widget .errorMsg {
    color: #dc2626 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    margin-top: 0.75rem !important;
    padding: 0.875rem 1rem !important;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, rgba(239, 68, 68, 0.05) 100%) !important;
    border-radius: 12px !important;
    border-left: 4px solid #dc2626 !important;
    animation: errorShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

/* Error input state */
.netlify-identity-widget input.error,
.netlify-identity-widget input:invalid:not(:placeholder-shown) {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
    animation: inputErrorPulse 0.3s ease !important;
}

@keyframes inputErrorPulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.2);
    }
}

/* ===== SUCCESS STATES ===== */
.netlify-identity-widget .success {
    color: #059669 !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    padding: 1rem 1.25rem !important;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(16, 185, 129, 0.05) 100%) !important;
    border-radius: 12px !important;
    border-left: 4px solid #059669 !important;
    animation: successFadeIn 0.4s ease !important;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LOADING SPINNER ===== */
.netlify-identity-widget .loading,
.netlify-identity-widget .spinner {
    border: 3px solid rgba(99, 102, 241, 0.2) !important;
    border-top-color: var(--modal-primary) !important;
    border-radius: 50% !important;
    animation: spinnerRotate 0.8s linear infinite !important;
}

@keyframes spinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

/* ===== FOOTER ===== */
.netlify-identity-widget .modalFooter,
.netlify-identity-widget .footer {
    padding: 1.25rem 2rem 1.75rem !important;
    text-align: center !important;
    background: rgba(248, 250, 252, 0.5) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.netlify-identity-widget .modalFooter p,
.netlify-identity-widget .footer p {
    color: #64748b !important;
    font-size: 0.875rem !important;
    margin: 0 !important;
}

/* ===== DARK MODE SUPPORT ===== */
[data-theme="dark"] .netlify-identity-widget .modal {
    background: var(--modal-glass-dark) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 100px rgba(99, 102, 241, 0.2) !important;
}

[data-theme="dark"] .netlify-identity-widget label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .netlify-identity-widget .formGroup:focus-within label {
    color: var(--modal-primary-light) !important;
}

[data-theme="dark"] .netlify-identity-widget input[type="text"],
[data-theme="dark"] .netlify-identity-widget input[type="email"],
[data-theme="dark"] .netlify-identity-widget input[type="password"] {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #f1f5f9 !important;
    box-shadow:
        inset 2px 2px 6px rgba(0, 0, 0, 0.3),
        inset -2px -2px 6px rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .netlify-identity-widget input:focus {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: var(--modal-primary-light) !important;
}

[data-theme="dark"] .netlify-identity-widget .tabs,
[data-theme="dark"] .netlify-identity-widget [role="tablist"] {
    background: rgba(99, 102, 241, 0.12) !important;
}

[data-theme="dark"] .netlify-identity-widget .tab,
[data-theme="dark"] .netlify-identity-widget [role="tab"] {
    color: #94a3b8 !important;
}

[data-theme="dark"] .netlify-identity-widget .modalFooter,
[data-theme="dark"] .netlify-identity-widget .footer {
    background: rgba(15, 23, 42, 0.5) !important;
    border-top-color: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .netlify-identity-widget .modalFooter p,
[data-theme="dark"] .netlify-identity-widget .footer p {
    color: #64748b !important;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 480px) {
    .netlify-identity-widget .modal {
        border-radius: 20px !important;
        max-width: 100% !important;
        width: 96% !important;
        margin: 0.5rem !important;
    }

    .netlify-identity-widget .modalHeader {
        padding: 1.5rem 1.5rem 1.25rem !important;
    }

    .netlify-identity-widget .modalHeader h1,
    .netlify-identity-widget .modalHeader .header {
        font-size: 1.4rem !important;
    }

    .netlify-identity-widget .tabs,
    .netlify-identity-widget [role="tablist"] {
        margin: 0 1.5rem 1.25rem !important;
    }

    .netlify-identity-widget .tab,
    .netlify-identity-widget [role="tab"] {
        padding: 0.75rem 1rem !important;
        font-size: 0.85rem !important;
    }

    .netlify-identity-widget .modalBody {
        padding: 0.5rem 1.5rem 1.5rem !important;
    }

    .netlify-identity-widget .modalFooter,
    .netlify-identity-widget .footer {
        padding: 1rem 1.5rem 1.5rem !important;
    }
}

/* ===== REDUCED MOTION PREFERENCE ===== */
@media (prefers-reduced-motion: reduce) {

    .netlify-identity-widget .modal,
    .netlify-identity-widget .modalWrapper,
    .netlify-identity-widget .modalHeader::before,
    .netlify-identity-widget .modalHeader::after,
    .netlify-identity-widget .modal::before {
        animation: none !important;
    }

    .netlify-identity-widget .error,
    .netlify-identity-widget .errorMsg {
        animation: none !important;
    }
}

/* Loading Spinner */
.netlify-identity-widget .loading,
.netlify-identity-widget .spinner {
    border-color: rgba(0, 174, 239, 0.2) !important;
    border-top-color: var(--auth-primary) !important;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
[data-theme="dark"] .auth-profile-trigger {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(71, 85, 105, 0.5);
    color: #f1f5f9;
}

[data-theme="dark"] .auth-profile-trigger:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: var(--auth-primary);
}

[data-theme="dark"] .auth-profile-menu {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(71, 85, 105, 0.5);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .auth-profile-menu a,
[data-theme="dark"] .auth-profile-menu button {
    color: #e2e8f0;
}

[data-theme="dark"] .auth-profile-menu a:hover,
[data-theme="dark"] .auth-profile-menu button:hover {
    background: linear-gradient(90deg, rgba(0, 174, 239, 0.15) 0%, transparent 100%);
}

[data-theme="dark"] .auth-signup-btn {
    color: var(--auth-primary-light) !important;
    border-color: var(--auth-primary-light);
}

[data-theme="dark"] .auth-signup-btn:hover {
    color: #fff !important;
}

/* Dark Mode Netlify Widget */
[data-theme="dark"] .netlify-identity-widget .modal {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
}

[data-theme="dark"] .netlify-identity-widget label {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .netlify-identity-widget input[type="text"],
[data-theme="dark"] .netlify-identity-widget input[type="email"],
[data-theme="dark"] .netlify-identity-widget input[type="password"] {
    background: rgba(51, 65, 85, 0.5) !important;
    border-color: rgba(71, 85, 105, 0.5) !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .netlify-identity-widget input:focus {
    background: rgba(51, 65, 85, 0.7) !important;
}

[data-theme="dark"] .netlify-identity-widget .tab {
    color: #94a3b8 !important;
}

[data-theme="dark"] .netlify-identity-widget .tab:hover {
    background: rgba(0, 174, 239, 0.1) !important;
}

[data-theme="dark"] .netlify-identity-widget .tab.active {
    color: var(--auth-primary-light) !important;
}

/* ============================================
   RESPONSIVE - ALL SCREEN SIZES
   ============================================ */
@media (max-width: 1024px) {
    .nav-auth.desktop-only {
        display: none;
    }
}

@media (max-width: 768px) {
    .netlify-identity-widget .modal {
        max-width: 95% !important;
        margin: 1rem !important;
        border-radius: 20px !important;
    }

    .netlify-identity-widget .modalBody {
        padding: 1.5rem !important;
    }

    .netlify-identity-widget .modalHeader {
        padding: 1.5rem !important;
    }

    .netlify-identity-widget .modalHeader h1 {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 480px) {

    .mobile-drawer .auth-login-btn,
    .mobile-drawer .auth-signup-btn {
        padding: 0.9rem 1.25rem;
        font-size: 0.95rem;
    }

    .netlify-identity-widget .modal {
        margin: 0.5rem !important;
        border-radius: 16px !important;
    }

    .netlify-identity-widget input[type="text"],
    .netlify-identity-widget input[type="email"],
    .netlify-identity-widget input[type="password"] {
        padding: 0.8rem !important;
        font-size: 0.95rem !important;
    }

    .netlify-identity-widget .btn-primary,
    .netlify-identity-widget button[type="submit"] {
        padding: 0.9rem 1.25rem !important;
        font-size: 0.95rem !important;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    .auth-login-btn,
    .auth-signup-btn,
    .auth-profile-trigger,
    .auth-profile-menu,
    .netlify-identity-widget .modal,
    .netlify-identity-widget .modalWrapper {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Focus States */
.auth-login-btn:focus-visible,
.auth-signup-btn:focus-visible,
.auth-profile-trigger:focus-visible {
    outline: 3px solid var(--auth-primary);
    outline-offset: 3px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .auth-login-btn,
    .auth-signup-btn,
    .auth-profile-dropdown,
    .netlify-identity-widget {
        display: none !important;
    }
}