/* =========================================================================
   בתכלס אנחנו יכולים הכל — עיצוב האתר
   פלטה: "התדר בחושך" — רקע כחול-לילה עמוק, זהב מגנטי, כתום-אמבר לאנרגיה
   טיפוגרפיה: Frank Ruhl Libre (כותרות) + Heebo (טקסט)
   ========================================================================= */

:root {
    --bg:        #0a0d2c;
    --bg-alt:    #0f1238;
    --bg-card:   #141829;
    --line:      rgba(212, 168, 83, 0.18);
    --line-strong: rgba(212, 168, 83, 0.36);
    --gold:      #d4a853;
    --gold-soft: #e0b86a;
    --ember:     #f4a460;
    --turquoise: #2dd4bf;
    --turquoise-soft: #5eead4;
    --pink:      #ec6fa8;
    --pink-soft: #f4a0c6;
    --mint:      #34d399;
    --text:      #f5f5f5;
    --text-muted:#b0b8d1;
    --text-dim:  #7a85a0;
    --success:   #7cc6a1;
    --danger:    #ff8080;

    --font-display: 'Frank Ruhl Libre', 'David Libre', serif;
    --font-body: 'Heebo', 'Arial Hebrew', sans-serif;

    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --shadow-glow: 0 0 60px rgba(232, 176, 75, 0.10);
    --container: 1120px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 900px 600px at 15% -10%, rgba(212,168,83,0.08), transparent 60%),
        radial-gradient(ellipse 700px 500px at 110% 20%, rgba(236,111,168,0.07), transparent 60%),
        radial-gradient(ellipse 600px 500px at 50% 110%, rgba(45,212,191,0.06), transparent 60%);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 78px; /* מקום לתפריט התחתון הקבוע */
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.35rem; }

p { color: var(--text-muted); margin: 0 0 1em; }

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }

img { max-width: 100%; display: block; }

::selection { background: var(--gold); color: #1a1200; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--gold-soft);
    margin-bottom: 14px;
}
.eyebrow::before {
    content: '';
    width: 22px;
    height: 1px;
    background: var(--gold);
}

.section {
    padding: 96px 0;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.section--alt { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); }
.section-head {
    max-width: 640px;
    margin-bottom: 56px;
}
.section-head p { font-size: 1.05rem; }

/* ---------------------------------------------------------------------
   Topbar (עליון, דק) + Bottom app nav (קבוע, בסגנון אפליקציה)
   --------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    background: rgba(10, 13, 44, 0.86);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.brand-mark {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--gold);
    background: conic-gradient(from 45deg, var(--gold), var(--pink), var(--turquoise), var(--gold));
    box-shadow: 0 0 14px rgba(212,168,83,0.45);
    flex-shrink: 0;
}
.topbar-auth { display: flex; gap: 10px; }
.topbar-user {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-muted); font-size: 0.88rem;
}
.topbar-user:hover { color: var(--pink-soft); }
.topbar-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--turquoise), var(--gold));
    color: #0a0d2c; font-weight: 700; font-family: var(--font-display);
}

.bottom-nav {
    position: fixed;
    bottom: 0; right: 0; left: 0;
    z-index: 200;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    max-width: 560px;
    margin: 0 auto;
    background: rgba(15, 18, 56, 0.92);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line-strong);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(0,0,0,0.35);
}
@media (min-width: 560px) {
    .bottom-nav { bottom: 18px; border-radius: 22px; border-bottom: 1px solid var(--line-strong); box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
}
.bn-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 16px;
    color: var(--text-dim);
    font-size: 0.72rem;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.bn-icon { width: 22px; height: 22px; }
.bn-icon svg { width: 100%; height: 100%; }
.bn-tab:hover { color: var(--text); transform: translateY(-2px); }
/* כל טאב מקבל צבע פעיל משלו — זה מה שנותן את התחושה החיה */
.bn-0.active { color: var(--gold-soft); background: rgba(212,168,83,0.12); }
.bn-1.active { color: var(--turquoise-soft); background: rgba(45,212,191,0.12); }
.bn-2.active { color: var(--pink-soft); background: rgba(236,111,168,0.12); }
.bn-3.active { color: var(--mint); background: rgba(52,211,153,0.12); }
.bn-4.active { color: var(--gold-soft); background: rgba(212,168,83,0.12); }
.bn-tab.active { transform: translateY(-2px); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold {
    background: linear-gradient(135deg, var(--gold-soft), var(--gold));
    color: #1a1200;
    box-shadow: 0 8px 24px rgba(232,176,75,0.25);
}
.btn-gold:hover { color: #1a1200; box-shadow: 0 10px 30px rgba(232,176,75,0.38); }
.btn-outline {
    border-color: var(--line-strong);
    color: var(--text);
    background: transparent;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-pink {
    background: linear-gradient(135deg, var(--pink-soft), var(--pink));
    color: #2a0a1a;
    box-shadow: 0 8px 24px rgba(236,111,168,0.28);
}
.btn-pink:hover { color: #2a0a1a; box-shadow: 0 10px 30px rgba(236,111,168,0.4); }
.btn-turquoise {
    background: linear-gradient(135deg, var(--turquoise-soft), var(--turquoise));
    color: #062421;
    box-shadow: 0 8px 24px rgba(45,212,191,0.28);
}
.btn-turquoise:hover { color: #062421; box-shadow: 0 10px 30px rgba(45,212,191,0.4); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------------
   Hero + טבעת התדר (האלמנט החתימה של האתר)
   --------------------------------------------------------------------- */
.hero {
    padding: 88px 0 60px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
}
.hero p.lead { font-size: 1.12rem; max-width: 46ch; }
.hero-ctas { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-quote {
    margin-top: 34px;
    padding-right: 18px;
    border-right: 2px solid var(--gold);
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.freq-ring-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.freq-ring {
    width: min(340px, 80vw);
    aspect-ratio: 1;
    position: relative;
}
.freq-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.freq-ring circle.track { stroke: rgba(232,176,75,0.14); fill: none; }
.freq-ring circle.progress {
    stroke: var(--gold);
    fill: none;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(232,176,75,0.65));
}
.freq-ring .ring-core {
    position: absolute; inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 20px;
}
.freq-ring .ring-core .num {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--gold-soft);
    line-height: 1;
}
.freq-ring .ring-core .label {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    margin-top: 6px;
}
.freq-ring.idle circle.progress { animation: pulse-ring 3.4s ease-in-out infinite; }
.freq-ring.idle .ring-core { animation: pulse-core 3.4s ease-in-out infinite; }
@keyframes pulse-ring {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}
@keyframes pulse-core {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}

/* ---------------------------------------------------------------------
   כרטיסים / רשימות
   --------------------------------------------------------------------- */
.grid {
    display: grid;
    gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 26px;
}

.rule-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 24px 22px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.rule-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.rule-num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold);
    flex-shrink: 0;
    min-width: 2ch;
}
.rule-card p { color: var(--text); margin: 0; font-size: 1.02rem; }
/* מחזור צבעים חי בין הכרטיסים */
.rule-card.c0 { border-inline-start: 3px solid var(--gold); }
.rule-card.c0 .rule-num { color: var(--gold-soft); }
.rule-card.c1 { border-inline-start: 3px solid var(--turquoise); }
.rule-card.c1 .rule-num { color: var(--turquoise-soft); }
.rule-card.c2 { border-inline-start: 3px solid var(--pink); }
.rule-card.c2 .rule-num { color: var(--pink-soft); }

.accent-turquoise { color: var(--turquoise-soft) !important; }
.accent-turquoise::before { background: var(--turquoise) !important; }
.accent-pink { color: var(--pink-soft) !important; }
.accent-pink::before { background: var(--pink) !important; }

.pillar {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 30px 26px;
}
.pillar .eyebrow { margin-bottom: 8px; }
.pillar p { font-size: 0.98rem; }
.pillar.p0 .eyebrow { color: var(--gold-soft); }
.pillar.p0 .eyebrow::before { background: var(--gold); }
.pillar.p1 .eyebrow { color: var(--turquoise-soft); }
.pillar.p1 .eyebrow::before { background: var(--turquoise); }
.pillar.p2 .eyebrow { color: var(--pink-soft); }
.pillar.p2 .eyebrow::before { background: var(--pink); }

/* ---------------------------------------------------------------------
   כרטיסי פיצ'ר צבעוניים (עמוד הבית)
   --------------------------------------------------------------------- */
.feature-grid { gap: 18px; }
.feature-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 26px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-card h3 { color: var(--text); margin-bottom: 6px; }
.feature-card p { margin: 0; font-size: 0.92rem; }
.feature-icon { font-size: 1.8rem; margin-bottom: 12px; }
.fc-turquoise:hover { border-color: var(--turquoise); box-shadow: 0 10px 30px rgba(45,212,191,0.15); }
.fc-turquoise .feature-icon { filter: drop-shadow(0 0 6px rgba(45,212,191,0.5)); }
.fc-pink:hover { border-color: var(--pink); box-shadow: 0 10px 30px rgba(236,111,168,0.15); }
.fc-pink .feature-icon { filter: drop-shadow(0 0 6px rgba(236,111,168,0.5)); }
.fc-mint:hover { border-color: var(--mint); box-shadow: 0 10px 30px rgba(52,211,153,0.15); }
.fc-mint .feature-icon { filter: drop-shadow(0 0 6px rgba(52,211,153,0.5)); }
.fc-gold:hover { border-color: var(--gold); box-shadow: 0 10px 30px rgba(212,168,83,0.15); }
.fc-gold .feature-icon { filter: drop-shadow(0 0 6px rgba(212,168,83,0.5)); }

/* ---------------------------------------------------------------------
   ממיר מחשבות
   --------------------------------------------------------------------- */
.converter {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 34px;
}
.converter textarea {
    width: 100%;
    min-height: 110px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
}
.converter-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0;
    color: var(--gold);
    font-size: 1.4rem;
}
.converter-result {
    background: var(--bg-alt);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    min-height: 60px;
    color: var(--gold-soft);
    font-family: var(--font-display);
    font-size: 1.15rem;
}
.converter-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.hint { font-size: 0.82rem; color: var(--text-dim); margin-top: 10px; }

/* ---------------------------------------------------------------------
   טפסים (התחברות / הרשמה / יומן)
   --------------------------------------------------------------------- */
.auth-shell {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 40px 34px;
    box-shadow: var(--shadow-glow);
}
.auth-card h1 { font-size: 1.7rem; text-align: center; }
.auth-card .sub { text-align: center; margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.field input, .field textarea, .field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-alt);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.98rem;
}
.field input:focus, .field textarea:focus { border-color: var(--gold); }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 18px;
}
.alert-error { background: rgba(255,128,128,0.12); border: 1px solid rgba(255,128,128,0.35); color: var(--danger); }
.alert-success { background: rgba(124,198,161,0.12); border: 1px solid rgba(124,198,161,0.35); color: var(--success); }

.form-footer-link { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--text-dim); }

/* ---------------------------------------------------------------------
   יומן תודות
   --------------------------------------------------------------------- */
.journal-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    align-items: start;
}
.gratitude-item-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.gratitude-item-row input { flex: 1; }
.remove-row {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    width: 40px;
    cursor: pointer;
}
.remove-row:hover { color: var(--danger); border-color: var(--danger); }

.tod-toggle { display: flex; gap: 10px; margin-bottom: 18px; }
.tod-toggle label {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.tod-toggle input { display: none; }
.tod-toggle input:checked + span { color: var(--turquoise-soft); }
.tod-toggle label:has(input:checked) { border-color: var(--turquoise); background: rgba(45,212,191,0.08); }

.entry-list { display: flex; flex-direction: column; gap: 14px; }
.entry-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 20px 22px;
}
.entry-card .entry-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.82rem;
    color: var(--text-dim);
}
.entry-card ul { margin: 0; padding-inline-start: 20px; color: var(--text); }
.entry-card ul li { margin-bottom: 4px; }
.entry-card .entry-note { margin-top: 10px; font-size: 0.92rem; color: var(--text-muted); }
.entry-delete {
    background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.82rem;
}
.entry-delete:hover { color: var(--danger); }
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-dim);
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
}

/* ---------------------------------------------------------------------
   צ'אט עם גיא
   --------------------------------------------------------------------- */
.chat-shell {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.chat-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1.5px solid var(--gold);
    background: conic-gradient(from 45deg, var(--gold), var(--pink), var(--turquoise), var(--gold));
    box-shadow: 0 0 12px rgba(212,168,83,0.45);
    flex-shrink: 0;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.msg { max-width: 78%; padding: 12px 16px; border-radius: var(--radius-md); line-height: 1.6; font-size: 0.96rem; }
.msg-guy { align-self: flex-start; background: var(--bg-alt); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--text); }
.msg-user { align-self: flex-end; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #1a1200; border-bottom-right-radius: 4px; }
.msg-typing { align-self: flex-start; color: var(--text-dim); font-size: 0.85rem; }
.chat-input-row {
    border-top: 1px solid var(--line);
    padding: 16px;
    display: flex;
    gap: 10px;
}
.chat-input-row textarea {
    flex: 1;
    resize: none;
    min-height: 48px;
    max-height: 140px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 0.96rem;
}
.chat-disclaimer {
    font-size: 0.76rem;
    color: var(--text-dim);
    text-align: center;
    padding: 8px 20px 0;
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
footer.site-footer {
    padding: 50px 0 34px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}
footer.site-footer .foot-note {
    max-width: 560px;
    margin: 0 auto 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .freq-ring-wrap { order: -1; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .journal-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .section { padding: 64px 0; }
    .topbar-user-name { display: none; }
    .bn-label { font-size: 0.68rem; }
}
