/* ============================================================
   LOAR — Design System CSS
   Mobile-first: ≤768px = app mobile
   Desktop: ≥769px = sidebar + grid layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600&family=Inter:wght@400;500;600;700&display=swap');

/* ── TOKENS ── */
:root {
    --bg: #FAF4F4;
    --bg-warm: #F8F5EE;
    --bg-form: #F5F0E8;
    --white: #FFFFFF;
    --dark: #191825;
    --card-dark: #1E1B2E;
    --muted: #9EA1A7;
    --accent-gold: #C9963A;
    --accent-gold-light: #D6B782;
    --accent-pink: #E5A1A8;
    --accent-pink-dark: #D3869B;
    --accent-teal: #5CC8C0;
    --star: #F4B942;
    --nav-active: #191825;
    --nav-inactive: #B0B5C0;
    --border: rgba(25,24,37,0.08);
    --border-md: rgba(25,24,37,0.15);
    --shadow-sm: 0 4px 12px rgba(25,24,37,0.06);
    --shadow-md: 0 8px 24px rgba(25,24,37,0.10);
    --shadow-lg: 0 16px 40px rgba(25,24,37,0.14);
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

button { font-family: inherit; cursor: pointer; }

/* ── MOBILE APP SHELL (≤ 768px) ── */
.app-shell {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.4rem 6rem;
}

/* ── BOTTOM NAV (mobile only) ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.7rem 0 1rem;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0 0.5rem;
    transition: opacity 0.2s;
}

.nav-item:hover { opacity: 0.7; }
.nav-icon { font-size: 1.5rem; line-height: 1; }
.nav-label { font-size: 0.65rem; font-weight: 600; color: var(--nav-inactive); }
.nav-item.active .nav-label { color: var(--nav-active); font-weight: 700; }
.nav-active-dot {
    width: 5px; height: 5px;
    background: var(--accent-gold);
    border-radius: 50%; margin-top: 2px;
}

/* ── SIDEBAR (desktop hidden on mobile) ── */
.sidebar { display: none; }
.desktop-topbar { display: none; }
.desktop-main { display: block; }

/* ── SHARED COMPONENTS ── */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--dark);
    color: white;
    box-shadow: 0 8px 20px rgba(25,24,37,0.18);
}

.btn-primary:hover {
    background: #2c2a3d;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(25,24,37,0.22);
}

.btn-secondary {
    background: transparent;
    color: var(--dark);
    border: 1.5px solid var(--border-md);
}

.btn-secondary:hover {
    border-color: rgba(25,24,37,0.3);
    background: rgba(25,24,37,0.02);
    transform: translateY(-2px);
}

.btn-full { width: 100%; }

/* Inputs */
.input-field {
    width: 100%;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: var(--white);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--dark);
    outline: none;
    transition: all 0.25s ease;
}

.input-field::placeholder { color: var(--muted); }

.input-field:focus {
    border-color: rgba(25,24,37,0.4);
    box-shadow: 0 4px 14px rgba(25,24,37,0.06);
    background: var(--white);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-dark {
    background: var(--card-dark);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Section label */
.section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

/* Tags */
.tag {
    background: rgba(25,24,37,0.06);
    color: var(--dark);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
}

/* Stars */
.stars { display: flex; gap: 1px; }
.star-filled { color: var(--star); font-size: 0.8rem; }
.star-empty  { color: #DDD; font-size: 0.8rem; }

/* LOAR Logo SVG helper */
.gaia-logo-svg { animation: float 6s ease-in-out infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DESKTOP LAYOUT (≥ 769px)
   ============================================================ */
@media (min-width: 769px) {

    /* ── Reset app-shell for desktop ── */
    .app-shell {
        max-width: none;
        width: 100%;
        margin: 0;
        flex-direction: row;
        min-height: 100vh;
    }

    /* ── Hide mobile-only elements ── */
    .bottom-nav { display: none !important; }
    .scroll-body {
        padding: 2.5rem 2.5rem 2.5rem;
        overflow-y: visible;
        max-width: none;
    }

    /* ── Sidebar ── */
    .sidebar {
        display: flex;
        flex-direction: column;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
        background: var(--white);
        border-right: 1px solid var(--border);
        min-height: 100vh;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        z-index: 200;
        padding: 2rem 1.2rem 1.5rem;
        transition: width 0.3s ease;
    }

    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 2.5rem;
        text-decoration: none;
    }

    .sidebar-logo-text {
        font-family: 'Cinzel', serif;
        font-size: 1.4rem;
        font-weight: 500;
        letter-spacing: 0.2em;
        color: var(--dark);
    }

    .sidebar-logo-sub {
        font-size: 0.55rem;
        letter-spacing: 0.3em;
        color: var(--accent-gold);
        font-weight: 700;
        text-transform: uppercase;
        margin-top: -4px;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex: 1;
    }

    .sidebar-nav-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        border-radius: var(--radius-md);
        text-decoration: none;
        color: var(--muted);
        font-size: 0.9rem;
        font-weight: 500;
        transition: all 0.2s ease;
        cursor: pointer;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
    }

    .sidebar-nav-item:hover {
        background: rgba(25,24,37,0.04);
        color: var(--dark);
    }

    .sidebar-nav-item.active {
        background: rgba(25,24,37,0.06);
        color: var(--dark);
        font-weight: 600;
    }

    .sidebar-nav-item.active::before {
        content: '';
        position: absolute;
        left: 0;
        width: 3px;
        height: 28px;
        background: var(--accent-gold);
        border-radius: 0 4px 4px 0;
        margin-left: -1.2rem;
    }

    .sidebar-nav-item { position: relative; }

    .sidebar-nav-icon { font-size: 1.2rem; flex-shrink: 0; }
    .sidebar-nav-label { line-height: 1; }

    /* Sidebar divider */
    .sidebar-divider {
        height: 1px;
        background: var(--border);
        margin: 1rem 0;
    }

    /* Sidebar user */
    .sidebar-user {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
        border-radius: var(--radius-md);
        background: rgba(25,24,37,0.03);
        cursor: pointer;
        transition: background 0.2s;
        text-decoration: none;
    }

    .sidebar-user:hover { background: rgba(25,24,37,0.06); }

    .sidebar-avatar {
        width: 36px; height: 36px;
        border-radius: 10px;
        background: #FDDDE0;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .sidebar-user-name {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-user-role {
        font-size: 0.7rem;
        color: var(--muted);
        margin-top: 1px;
    }

    /* ── Desktop Main Area ── */
    .desktop-main {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    /* ── Desktop Top Bar ── */
    .desktop-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 2.5rem;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 100;
        height: var(--topbar-height);
    }

    .desktop-topbar-title {
        font-size: 1rem;
        font-weight: 600;
        color: var(--dark);
    }

    .desktop-topbar-right {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .topbar-avatar-btn {
        width: 38px; height: 38px;
        border-radius: 12px;
        background: #FDDDE0;
        border: none;
        cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.2rem;
        transition: transform 0.2s;
    }

    .topbar-avatar-btn:hover { transform: scale(1.05); }

    /* ── Desktop Content Wrapper ── */
    .desktop-content {
        flex: 1;
        padding: 2.5rem;
        overflow-y: auto;
    }

    /* ── Desktop Grid Layouts ── */
    .desktop-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }

    .desktop-grid-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1.25rem;
    }

    .desktop-grid-main-aside {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 1.5rem;
        align-items: start;
    }

    /* ── Desktop Page Header ── */
    .desktop-page-header {
        margin-bottom: 2rem;
    }

    .desktop-page-title {
        font-size: 2rem;
        font-weight: 700;
        color: var(--dark);
        line-height: 1.2;
        margin-bottom: 0.3rem;
    }

    .desktop-page-sub {
        font-size: 0.9rem;
        color: var(--accent-gold);
        font-weight: 500;
    }

    /* ── Bigger cards on desktop ── */
    .card { padding: 1.5rem; }
    .card-dark { padding: 1.5rem; }

    /* ── Auth pages (login/register/index) ── */
    .auth-split {
        display: flex;
        min-height: 100vh;
    }

    .auth-panel-left {
        flex: 1;
        background: var(--card-dark);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 3rem;
        position: relative;
        overflow: hidden;
    }

    .auth-panel-left::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse at 30% 50%, rgba(211,134,155,0.15) 0%, transparent 60%),
                    radial-gradient(ellipse at 70% 20%, rgba(92,200,192,0.08) 0%, transparent 50%);
    }

    .auth-panel-left-content {
        position: relative;
        z-index: 1;
        text-align: center;
        max-width: 380px;
    }

    .auth-panel-right {
        width: 480px;
        min-width: 480px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 3rem 3.5rem;
        background: var(--bg-warm);
    }

    .auth-panel-right-inner {
        width: 100%;
        max-width: 380px;
    }

    /* Brand elements inside left panel */
    .auth-brand-name {
        font-family: 'Cinzel', serif;
        font-size: 4rem;
        font-weight: 500;
        letter-spacing: 0.25em;
        color: white;
        margin-bottom: 0;
    }

    .auth-brand-sub-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
        margin: 0.5rem 0 2rem;
    }

    .auth-brand-line {
        height: 1px;
        width: 50px;
        background: var(--accent-gold-light);
        opacity: 0.6;
    }

    .auth-brand-care {
        font-size: 0.8rem;
        letter-spacing: 0.4em;
        color: var(--accent-gold-light);
        font-weight: 600;
    }

    .auth-brand-desc {
        font-size: 0.8rem;
        line-height: 1.7;
        color: rgba(255,255,255,0.5);
        letter-spacing: 0.1em;
        text-transform: uppercase;
        font-weight: 500;
    }

    /* Auth circles decoration */
    .bg-circles { display: none; }

    /* ── Anamnese desktop ── */
    .anamnese-desktop-wrap {
        display: grid;
        grid-template-columns: 220px 1fr;
        gap: 2rem;
        min-height: calc(100vh - var(--topbar-height));
        padding: 2rem 2.5rem;
    }

    .anamnese-steps-sidebar {
        position: sticky;
        top: calc(var(--topbar-height) + 2rem);
        height: fit-content;
    }

    .anamnese-step-item {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.5rem 0.75rem;
        border-radius: var(--radius-sm);
        font-size: 0.8rem;
        color: var(--muted);
        cursor: pointer;
        transition: all 0.2s;
    }

    .anamnese-step-item.done { color: var(--accent-teal); }
    .anamnese-step-item.current { background: rgba(25,24,37,0.05); color: var(--dark); font-weight: 600; }

    .anamnese-step-num {
        width: 22px; height: 22px;
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 0.68rem;
        font-weight: 700;
        background: rgba(25,24,37,0.08);
        color: var(--muted);
        flex-shrink: 0;
    }

    .anamnese-step-item.done .anamnese-step-num {
        background: var(--accent-teal);
        color: white;
    }

    .anamnese-step-item.current .anamnese-step-num {
        background: var(--dark);
        color: white;
    }

    .anamnese-form-area {
        background: var(--white);
        border-radius: var(--radius-xl);
        padding: 2rem;
        box-shadow: var(--shadow-sm);
    }
}

/* ── Large desktop ── */
@media (min-width: 1200px) {
    :root { --sidebar-width: 260px; }

    .desktop-content { padding: 3rem; }

    .auth-panel-right {
        width: 520px;
        min-width: 520px;
    }
}
