/* ═══════════════════════════════════════════════════════════════
   FRESHMILK TOGO — base.css
   Tokens, reset, header, login, view-section, responsive
   ═══════════════════════════════════════════════════════════════ */

/* ═══ DESIGN TOKENS ═══ */
:root {
    --bg-main: #050505;
    --bg-panel: #0a0a0a;
    --accent-gradient: linear-gradient(135deg, #FFFFFF 0%, #A0A0A0 100%);
    --border-soft: rgba(255, 255, 255, 0.08);
}

/* ═══ RESET & BODY ═══ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: #FFFFFF;
    margin: 0;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* Hide scrollbars */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ═══ GLOBAL HEADER ═══ */
.fm-header {
    --h: clamp(56px, 10vw, 70px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 calc(var(--h) * 0.2);
    background: rgba(10, 10, 10, 0.80);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 50;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .fm-header {
        padding: 0 2.5rem;
    }
}

/* Logo */
.fm-logo {
    display: flex;
    align-items: center;
    gap: calc(var(--h) * 0.12);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0;
}

.fm-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: calc(var(--h) * 0.42);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #999 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0;
    line-height: 1;
}

.fm-logo-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: calc(var(--h) * 0.22);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #999 100%);
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: #000;
    color: #000;
    letter-spacing: 0.2em;
    padding: calc(var(--h) * 0.08) calc(var(--h) * 0.1);
    border-radius: 3px;
    line-height: 1;
    display: inline;
}

@media (max-width: 640px) {
    .fm-header {
        padding: 0 14px;
    }

    .fm-logo {
        gap: 7px;
    }

    .fm-logo-text {
        font-size: 18.5px;
        letter-spacing: -0.01em;
    }

    .fm-logo-badge {
        font-size: 10px;
        letter-spacing: 0.15em;
        padding: 3px 6px;
        border-radius: 3px;
    }

    .fm-header-right {
        gap: 16px;
    }

    .fm-hamburger {
        width: 36px;
        height: 36px;
        padding: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fm-hamburger svg {
        width: 20px;
        height: 20px;
    }

    .fm-lang-wrap {
        min-width: auto;
    }

    .fm-lang-btn {
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: 0.1em;
        padding: 0 4px;
        height: 36px;
        display: flex;
        align-items: center;
    }

    .fm-lang-arrow {
        font-size: 8px;
    }

    .fm-user-widget {
        gap: 0;
    }

    .fm-user-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
        font-weight: 800;
        color: #ffffff;
        border: 1.5px solid rgba(255, 255, 255, 0.6);
        background: rgba(255, 255, 255, 0.12);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
}

/* Header Right */
.fm-header-right {
    display: flex;
    align-items: center;
    gap: calc(var(--h) * 0.18);
    margin-left: auto;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .fm-header-right {
        gap: 1.5rem;
    }
}

/* Nav Desktop */
.fm-nav {
    display: none;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin-right: 0;
}

@media (min-width: 1280px) {
    .fm-nav {
        display: flex;
    }
    .fm-header-right {
        gap: 2rem;
    }
}

.fm-nav a {
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    color: #888;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.fm-nav a:hover,
.fm-nav a.active {
    color: #fff;
}

/* ═══ HAMBURGER (mobile only) ═══ */
.fm-hamburger {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: calc(var(--h) * 0.08);
    transition: color 0.2s;
}

.fm-hamburger svg {
    width: calc(var(--h) * 0.5);
    height: calc(var(--h) * 0.5);
}

.fm-hamburger:hover {
    color: #fff;
}

@media (max-width: 1279px) {
    .fm-hamburger {
        display: flex;
        align-items: center;
    }
}

@media (min-width: 1280px) {
    .fm-hamburger {
        display: none;
    }
}

/* Mobile Nav Overlay */
.fm-mobile-nav {
    display: none;
    position: fixed;
    top: clamp(56px, 10vw, 70px);
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 999;
    padding: 20px 24px;
    flex-direction: column;
    gap: 16px;
    animation: slideDown 0.2s ease-out;
}

.fm-mobile-nav.open {
    display: flex;
}

.fm-mobile-nav a {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #888;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fm-mobile-nav a:hover,
.fm-mobile-nav a.active {
    color: #fff;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Language Selector */
.fm-lang-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    color: #888;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
    font-family: inherit;
    padding: 0;
    line-height: 1;
}

.fm-lang-btn:hover {
    color: #fff;
}

.fm-lang-arrow {
    font-size: 8px;
    line-height: 1;
    display: inline-block;
    transform: translateY(-1px);
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.2s ease;
}

.fm-lang-btn:hover .fm-lang-arrow {
    color: rgba(255, 255, 255, 0.7);
}

/* Language Wrapper */
.fm-lang-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Language Dropdown */
.fm-lang-menu {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    margin-top: 0.5rem;
    min-width: 12rem;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 0.75rem;
    border: 1px solid rgba(192, 192, 192, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    z-index: 60;
    background: rgba(10, 10, 10, 0.95);
    padding: 0.25rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.fm-lang-menu::-webkit-scrollbar {
    width: 5px;
}

.fm-lang-menu::-webkit-scrollbar-track {
    background: transparent;
}

.fm-lang-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.fm-lang-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fm-lang-menu.open {
    display: block;
}

.fm-lang-option {
    width: 100%;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
}

.fm-lang-code {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.25);
    min-width: 28px;
    text-transform: uppercase;
}

.fm-lang-option:hover {
    color: #fff;
}

.fm-lang-option.active {
    color: #fff;
    background: none;
}

.fm-lang-option.active::before {
    content: '✓';
    position: absolute;
    left: 6px;
    color: rgba(192, 192, 192, 0.8);
    font-size: 8px;
}

.fm-lang-divider {
    height: 1px;
    background: rgba(192, 192, 192, 0.15);
    margin: 0 12px;
}

/* Header Divider */
.fm-header-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    display: none;
}

@media (min-width: 640px) {
    .fm-header-divider {
        display: block;
    }
}

/* ═══ USER WIDGET ═══ */
.fm-user-widget {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.fm-user-widget.visible {
    opacity: 1;
    pointer-events: auto;
}

.fm-user-info {
    display: none;
    flex-direction: column;
    text-align: right;
}

@media (min-width: 640px) {
    .fm-user-info {
        display: flex;
    }
}

.fm-user-name {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #fff;
    font-weight: 700;
    transition: color 0.2s ease;
}

.fm-user-widget:hover .fm-user-name {
    color: rgba(255, 255, 255, 0.8);
}

.fm-user-plan {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #FFD700;
}

.fm-user-avatar {
    width: calc(var(--h) * 0.5);
    height: calc(var(--h) * 0.5);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--h) * 0.18);
    font-weight: 700;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease;
}

.fm-user-widget:hover .fm-user-avatar {
    border-color: rgba(255, 255, 255, 0.4);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* User Dropdown */
.fm-user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 14rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    z-index: 60;
    background: rgba(14, 14, 14, 0.97);
    padding: 0.4rem;
}

.fm-user-menu.open {
    display: block;
}

/* Credits Card in User Menu */
.fm-menu-credits-card {
    padding: 0.75rem 0.85rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    cursor: default;
    margin-bottom: 0.4rem;
    transition: all 0.2s ease;
}

.fm-menu-credits-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fm-credit-diamond-icon {
    width: 17px;
    height: 17px;
    color: #ffffff;
    stroke: #ffffff;
    flex-shrink: 0;
    transition: color 0.2s, stroke 0.2s;
}

.fm-credit-label {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.85);
}

.fm-menu-credits-value {
    display: flex;
    align-items: baseline;
    padding-left: 2px;
}

.fm-menu-credits-card .fm-credit-count {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

/* Low credits state (< 50 credits) */
.fm-menu-credits-card.low {
    border-color: rgba(255, 77, 77, 0.45);
    background: rgba(255, 77, 77, 0.1);
}

.fm-menu-credits-card.low .fm-credit-diamond-icon {
    color: #ff4d4d;
    stroke: #ff4d4d;
}

.fm-menu-credits-card.low .fm-credit-count {
    color: #ff4d4d;
}

.fm-menu-credits-card.low .fm-credit-label {
    color: rgba(255, 120, 120, 0.95);
}

/* User Menu Logout Button */
.fm-user-menu button,
.fm-user-menu-logout {
    width: 100%;
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: none;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.fm-user-menu button:hover,
.fm-user-menu-logout:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.fm-logout-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #ffffff;
    stroke: #ffffff;
    opacity: 0.95;
}

/* ═══ MAIN VIEWPORT ═══
   Bulletproof: header 70px + footer 40px = 110px reserved.
   Main fills EXACTLY the space between them. Content NEVER overflows below footer.
   ═══ */
.fm-main {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 40px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══ VIEW SECTIONS ═══ */
.view-section {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.view-section.active {
    display: flex;
    opacity: 1;
}

/* ═══ VIEW LOADER — transition spinner between async views ═══ */
.view-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    background: var(--bg-main);
}

/* Hide library FAB while loader is active (FAB is position:fixed z-index:100) */
.view-loader~.lib-fab-wrap {
    display: none !important;
}

.view-loader-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: viewSpin 0.8s linear infinite;
}

@keyframes viewSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Form visibility — replaces inline style.display */
.form-hidden {
    display: none !important;
}

/* ═══ BUTTONS ═══ */
.btn-freshmilk {
    background: var(--accent-gradient);
    color: #000;
    font-weight: 800;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-freshmilk:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
}

/* ═══ INPUT FIELDS ═══ */
.fm-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    color: #FFF;
    font-family: inherit;
    transition: all 0.3s ease;
}

.fm-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.fm-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* ═══ LOGIN SCREEN ═══ */
#view-login {
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-main);
    z-index: 5;
}

/* When login is active: hide nav, lang, divider, user widget, hamburger — only logo */
#view-login.active~#login-header-mask,
body:has(#view-login.active) .fm-nav,
body:has(#view-login.active) .fm-lang-btn,
body:has(#view-login.active) .fm-lang-wrap,
body:has(#view-login.active) .fm-header-divider,
body:has(#view-login.active) .fm-user-widget,
body:has(#view-login.active) .fm-hamburger,
body:has(#view-login.active) .fm-header-right {
    display: none !important;
}

/* Login screen: hide header entirely, main takes full height */
body:has(#view-login.active) .fm-header {
    display: none !important;
}

body:has(#view-login.active) .fm-main {
    top: 0;
}

/* Login inline logo (replaces header logo) */
.login-logo {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.login-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.4rem, 6vw, 2.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #999 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0;
    line-height: 1;
}

.login-logo-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.55rem, 2.2vw, 1rem);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #999 100%);
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: #000;
    color: #000;
    letter-spacing: 0.2em;
    padding: clamp(3px, 0.8vw, 6px) clamp(4px, 1vw, 8px);
    border-radius: 3px;
    line-height: 1;
}

/* ═══ LOGIN LANGUAGE SELECTOR (globe, top-right) ═══ */
.login-lang {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 20;
}

.login-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.6rem, 2.5vw, 0.7rem);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.login-lang-btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
}

.login-lang-arrow {
    opacity: 0.4;
}

.login-lang-list {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: min(160px, 50vw);
    max-height: 50vh;
    overflow-y: auto;
    background: rgba(10, 10, 10, 0.97);
    border: 1px solid rgba(192, 192, 192, 0.35);
    border-radius: 10px;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 4px 0;
}

.login-lang-list.open {
    display: block;
}

.login-lang-list::-webkit-scrollbar {
    width: 6px;
}

.login-lang-list::-webkit-scrollbar-track {
    background: transparent;
}

.login-lang-list::-webkit-scrollbar-thumb {
    background: rgba(192, 192, 192, 0.4);
    border-radius: 3px;
}

.login-lang-item {
    padding: 0.5rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.625rem, 2.5vw, 0.75rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-lang-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.login-lang-item.selected {
    color: #fff;
    background: rgba(192, 192, 192, 0.1);
}

.login-lang-item .login-lang-code {
    font-size: clamp(0.5rem, 2vw, 0.625rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
}

.login-card {
    width: 100%;
    max-width: min(92vw, 26rem);
    border-radius: clamp(1rem, 3vw, 1.5rem);
    padding: clamp(2rem, 5vw, 2.75rem) clamp(1.75rem, 4vw, 2.25rem) clamp(2.25rem, 5.5vw, 3rem);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.login-card-glow {
    position: absolute;
    top: 0;
    left: 25%;
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-title {
    font-size: clamp(1.4rem, 5vw, 1.75rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.login-subtitle {
    font-size: clamp(0.6rem, 2.5vw, 0.75rem);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 500;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.login-label {
    font-size: clamp(0.55rem, 2.2vw, 0.65rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0.5rem;
}

.login-input {
    width: 100%;
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.login-submit {
    width: 100%;
    border-radius: 1rem;
    padding: clamp(0.6rem, 2.5vw, 0.85rem);
    font-size: clamp(0.6rem, 2.5vw, 0.75rem);
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.login-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-divider-text {
    font-size: clamp(0.5rem, 2vw, 0.625rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Social / Alt Login Buttons */
.login-social-btn {
    width: 100%;
    margin-top: clamp(0.75rem, 2vw, 1rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, 2vw, 0.875rem);
    border-radius: 1rem;
    padding: clamp(0.7rem, 2.2vw, 0.875rem) 1rem;
    background: rgba(192, 192, 192, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.14);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.login-social-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(192, 192, 192, 0.25);
}

.login-social-btn svg {
    width: clamp(16px, 4vw, 20px);
    height: clamp(16px, 4vw, 20px);
    flex-shrink: 0;
}

.login-social-btn span {
    font-size: clamp(0.6rem, 2.5vw, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s ease;
}

.login-social-btn:hover span {
    color: #fff;
}

.login-social-btn:hover svg {
    opacity: 1;
}

/* Forgot / Back Links */
.login-link-wrap {
    margin-top: 0.5rem;
    text-align: center;
}

.login-link {
    font-size: 8px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    font-family: inherit;
}

.login-link:hover {
    color: #fff;
}

/* Login Panels (signup, forgot, reset, activated) */
.login-panel {
    display: none;
}

.login-panel.active {
    display: block;
}

.login-panel-text {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    text-align: center;
}

/* Back Button (← arrow) */
.login-back-btn {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
    font-family: inherit;
}

.login-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Footer Links (side by side) */
.login-footer-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding: 0 0.25rem;
}

/* Success States */
.login-success {
    display: none;
    margin-top: 1rem;
    text-align: center;
}

.login-success.visible {
    display: block;
}

.login-success-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-success-icon.blue {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.login-success-icon.blue svg {
    color: #60a5fa;
}

.login-success-icon.green {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.login-success-icon.green svg {
    color: #4ade80;
}

.login-success-title {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.login-success-sub {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
}

/* Activated Panel Content */
.activated-content {
    text-align: center;
    padding: 1rem 0;
}

.activated-content .login-success-icon {
    margin: 0 auto 0.75rem;
}

.activated-content .login-success-title {
    margin-bottom: 0.25rem;
}

.activated-content .login-success-sub {
    margin-bottom: 1rem;
}

/* ═══ LOGIN — MOBILE RESPONSIVE ═══ */
/* Only minimal layout overrides needed; clamp() handles sizing */
@media (max-width: 768px) {
    #view-login {
        padding: clamp(0.75rem, 2vw, 1rem);
        justify-content: flex-start;
        padding-top: clamp(6vh, 10vw, 12vh);
    }
}

/* ═══ GLOBAL FOOTER ═══ */
.fm-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-main);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 40;
}

.fm-footer-left,
.fm-footer-right {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.fm-footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fm-google-logo {
    height: 12px;
    width: auto;
    opacity: 0.35;
}

/* ═══ STEP NAVIGATION BAR ═══ */
.step-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.5rem;
    z-index: 10;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.step-back {
    background: none;
    border: none;
    color: #888;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: left;
}

.step-back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.step-title {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    flex: 1;
    text-align: center;
}

.step-progress {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #888;
    letter-spacing: 0.2em;
    min-width: 80px;
    text-align: right;
}

/* ═══ MODAL ═══ */
.fm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fm-modal-overlay.show {
    display: flex;
}

.fm-modal-card {
    max-width: 22rem;
    width: 90%;
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(192, 192, 192, 0.4);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    text-align: center;
    position: relative;
}

.fm-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(192, 192, 192, 0.5), transparent);
}

.fm-modal-text {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.fm-modal-ok {
    border-radius: 0.75rem;
    padding: 0.6rem 2.5rem;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #FFF 0%, #A0A0A0 100%);
    color: #000;
    font-weight: 800;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fm-modal-ok:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.fm-modal-ok:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ═══ SUBCATEGORY MODAL ═══ */
.subcat-modal-card {
    text-align: left;
    max-width: 24rem;
}

.subcat-modal-card .fm-modal-text {
    text-align: center;
    margin-bottom: 1.75rem;
    font-size: 12px;
}

.fm-modal-card-glow {
    position: absolute;
    top: 0;
    left: 25%;
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(192, 192, 192, 0.5), transparent);
}

.subcat-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.subcat-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0.5rem;
}

.subcat-category-display {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-left: 1rem;
}

.subcat-dropdown {
    position: relative;
    width: 100%;
}

.subcat-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.subcat-dropdown-trigger.has-value {
    color: #fff;
    font-weight: 600;
}

.subcat-dropdown-trigger:hover,
.subcat-dropdown.open .subcat-dropdown-trigger {
    border-color: rgba(255, 255, 255, 0.35);
}

.subcat-dropdown.open .subcat-dropdown-trigger svg {
    transform: rotate(180deg);
}

.subcat-dropdown-trigger svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.subcat-dropdown-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10;
    padding: 6px;
}

.subcat-dropdown.open .subcat-dropdown-list {
    display: block;
}

.subcat-search {
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    outline: none;
    margin-bottom: 4px;
    border-radius: 0;
    box-sizing: border-box;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subcat-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.subcat-items {
    max-height: 200px;
    overflow-y: auto;
}

.subcat-dropdown-item {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subcat-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.subcat-dropdown-item.selected {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
}

/* Scrollbar */
.subcat-items::-webkit-scrollbar {
    width: 4px;
}

.subcat-items::-webkit-scrollbar-track {
    background: transparent;
}

.subcat-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
}

.subcat-modal-card .fm-modal-ok {
    width: 100%;
    margin-top: 0.5rem;
}

/* ═══ TOAST ═══ */
.fm-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    z-index: 999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.fm-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══ KEYFRAMES ═══ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* ═══ HEADER — MOBILE: lang dropdown alignment ═══ */
@media (max-width: 768px) {
    .fm-lang-menu {
        left: auto;
        right: 0;
        transform: none;
    }
}

/* ═══ UTILITY ═══ */
.hidden {
    display: none !important;
}

/* ═══ CREDIT BADGE ═══ */
.fm-credit-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    cursor: default;
    transition: all 0.3s ease;
}

.fm-credit-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
}

.fm-credit-badge.low {
    border-color: rgba(255, 100, 80, 0.4);
    color: #ff6450;
    background: rgba(255, 100, 80, 0.08);
}

.fm-credit-badge.low .fm-credit-icon {
    stroke: #ff6450;
    opacity: 0.8;
}

@media (max-width: 640px) {
    .fm-credit-badge {
        padding: 3px 7px;
        font-size: 10px;
    }
    .fm-credit-icon {
        width: 12px;
        height: 12px;
    }
}

/* ═══ NO CREDITS MODAL ═══ */
.nc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    animation: ncFadeIn 0.25s ease forwards;
}

@keyframes ncFadeIn {
    to { opacity: 1; }
}

.nc-modal-card {
    width: 100%;
    max-width: 380px;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.92);
    animation: ncScaleIn 0.3s ease forwards;
}

@keyframes ncScaleIn {
    to { transform: scale(1); }
}

.nc-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(255, 100, 80, 0.1);
    border: 1px solid rgba(255, 100, 80, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nc-modal-icon svg {
    width: 28px;
    height: 28px;
    stroke: #ff6450;
}

.nc-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.nc-modal-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.nc-modal-sub strong {
    color: #ff6450;
    font-weight: 700;
}

.nc-modal-btn-upgrade {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff, #ccc);
    color: #000;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.nc-modal-btn-upgrade:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.nc-modal-btn-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 6px;
    transition: color 0.2s;
}

.nc-modal-btn-close:hover {
    color: rgba(255, 255, 255, 0.7);
}