:root {
    --green-950: #00351f;
    --green-900: #004c2d;
    --green-800: #00683a;
    --green-700: #087b49;
    --green-100: #dcefe5;
    --orange-500: #f68b1f;
    --orange-100: #fff0de;
    --cream: #f7f4ed;
    --paper: #fff;
    --ink: #173128;
    --muted: #687970;
    --line: #e6ece8;
    --danger: #b42318;
    --shadow: 0 18px 55px rgba(0, 67, 40, .12);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; overflow-x: hidden; background: var(--cream); -webkit-text-size-adjust: 100%; }

body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: "Vazirmatn", Tahoma, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
    background: var(--paper);
}

.auth-visual {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(30px, 5vw, 70px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(145deg, #0a8a57 0%, var(--green-800) 45%, var(--green-950) 100%);
    position: relative;
    overflow: hidden;
}

.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.event-kicker { direction: ltr; letter-spacing: .16em; font-weight: 800; font-size: 12px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange-500); box-shadow: 0 0 0 6px rgba(246,139,31,.18); }
.auth-copy { max-width: 690px; position: relative; z-index: 1; }
.overline { color: var(--orange-500); font-size: 13px; font-weight: 900; letter-spacing: .02em; margin: 0 0 10px; }
.auth-copy h1 { margin: 0; font-size: clamp(38px, 5vw, 72px); line-height: 1.25; letter-spacing: -.04em; }
.auth-copy > p:last-child { margin: 24px 0 0; max-width: 580px; color: rgba(255,255,255,.78); font-size: clamp(15px, 1.35vw, 19px); line-height: 2; }

.journey-step { display: flex; align-items: center; max-width: 410px; position: relative; z-index: 1; }
.step-dot { width: 11px; height: 11px; border: 2px solid rgba(255,255,255,.45); border-radius: 50%; }
.step-dot.is-done { background: #fff; border-color: #fff; }
.step-dot.is-current { background: var(--orange-500); border-color: var(--orange-500); box-shadow: 0 0 0 6px rgba(246,139,31,.18); }
.step-line { height: 1px; flex: 1; background: rgba(255,255,255,.3); }

.auth-card {
    width: min(100%, 560px);
    margin: auto;
    padding: clamp(32px, 6vw, 82px);
}
/* لوگوی «سفر فناورانه» وسط‌چین (قبلاً کنار بود). */
.auth-logo { width: 155px; height: auto; display: block; margin: 0 auto 44px; }
.auth-heading h2 { font-size: clamp(28px, 3vw, 38px); margin: 0 0 10px; color: var(--green-950); }
.auth-heading p { margin: 0; color: var(--muted); line-height: 1.9; }
.login-form { margin-top: 38px; }
.login-form label { display: block; margin-bottom: 10px; color: var(--green-950); font-size: 14px; font-weight: 800; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 21px; color: var(--green-700); }
.input-wrap input {
    width: 100%;
    height: 58px;
    padding: 0 52px 0 18px;
    border: 1px solid #dbe5df;
    border-radius: 16px;
    outline: none;
    direction: ltr;
    text-align: right;
    background: #fbfdfc;
    color: var(--green-950);
    font-size: 18px;
    letter-spacing: .08em;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap input:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(8,123,73,.12); background: #fff; }
.field-help { margin: 9px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.form-error { display: flex; gap: 8px; align-items: center; margin: 14px 0 0; color: var(--danger); font-size: 13px; }
.form-error svg { width: 18px; flex: 0 0 auto; }
.primary-button {
    min-height: 56px;
    margin-top: 26px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background: var(--orange-500);
    box-shadow: 0 10px 26px rgba(246,139,31,.24);
    cursor: pointer;
    font-weight: 900;
    transition: transform .16s, box-shadow .16s;
}
.login-form .primary-button { width: 100%; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(246,139,31,.31); }
.primary-button:active { transform: translateY(0); }
.primary-button svg { width: 19px; }

.app-page { background: #e9efeb; }
.app-shell { width: min(100%, 600px); min-height: 100dvh; margin: 0 auto; padding-bottom: calc(96px + var(--safe-bottom)); background: var(--cream); box-shadow: 0 0 70px rgba(0,53,31,.1); position: relative; }
.app-header { height: 82px; padding: 15px 22px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.mini-brand { display: flex; align-items: center; gap: 11px; }
.mini-brand img { width: 64px; height: auto; }
.mini-brand span { font-size: 12px; color: var(--green-800); font-weight: 900; border-right: 1px solid var(--line); padding-right: 10px; }
.member-menu { display: flex; align-items: center; gap: 9px; }
.member-avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--green-800); border-radius: 50%; font-weight: 900; }
.member-menu > div { display: grid; line-height: 1.3; }
.member-menu strong { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.member-greeting { color: var(--muted); font-size: 10px; }
.icon-link { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); border-radius: 12px; }
.icon-link:hover { color: var(--green-800); background: var(--green-100); }
.icon-link svg { width: 19px; }

.live-content { padding: 22px 20px 18px; }
.live-hero { min-height: 240px; padding: 22px; color: #fff; background: linear-gradient(140deg, #0b8755 0%, var(--green-800) 52%, var(--green-950) 100%); border-radius: var(--radius-xl); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.live-meta { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.1); font-size: 11px; font-weight: 800; }
.status-chip > span { width: 7px; height: 7px; border-radius: 50%; background: #a8b7b0; }
.status-chip.is-live > span { background: var(--orange-500); box-shadow: 0 0 0 5px rgba(246,139,31,.18); animation: livePulse 1.5s ease-in-out infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 8px rgba(246,139,31,0); } }
.pitch-count { font-size: 12px; color: rgba(255,255,255,.75); direction: rtl; }
.timer-card { margin-top: 37px; position: relative; z-index: 1; text-align: center; }
.timer-label { color: rgba(255,255,255,.67); font-size: 12px; }
.timer-value { margin: 2px 0 16px; direction: ltr; font-size: clamp(48px, 14vw, 76px); font-weight: 250; line-height: 1.2; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.timer-track { width: min(100%, 340px); height: 4px; margin: auto; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.16); direction: ltr; }
.timer-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--orange-500); transform-origin: left; transition: transform .25s linear, background .2s; }
.live-hero.is-urgent .timer-value { color: #ffd7b0; }
.live-hero.is-urgent .timer-track span { background: #ffb36a; }

.idea-card { min-height: 310px; margin-top: 16px; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--paper); box-shadow: 0 10px 35px rgba(0,53,31,.065); }
.empty-state { min-height: 258px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--green-700); background: var(--green-100); border-radius: 20px; }
.empty-icon svg { width: 27px; }
.empty-state h1 { margin: 19px 0 7px; font-size: 21px; color: var(--green-950); }
.empty-state p { max-width: 350px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; }
.idea-content .overline { margin-bottom: 8px; }
.idea-content h1 { min-height: 72px; margin: 0; color: var(--green-950); font-size: clamp(24px, 6.5vw, 32px); line-height: 1.55; }
.presenter-row { margin-top: 20px; padding: 14px; display: flex; align-items: center; gap: 12px; background: #f5f8f6; border-radius: 17px; }
.presenter-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-800); background: var(--green-100); border-radius: 14px; }
.presenter-mark svg { width: 20px; }
.presenter-row > div { display: grid; }
.presenter-row span { color: var(--muted); font-size: 10px; }
.presenter-row strong { color: var(--green-950); font-size: 14px; }
.idea-actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reaction-button { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--green-950); cursor: pointer; font-weight: 800; transition: border-color .18s, background .18s, color .18s, transform .14s; }
.reaction-button:hover { border-color: #b8ccc0; transform: translateY(-1px); }
.reaction-button:active { transform: scale(.98); }
.reaction-button svg { width: 21px; }
.reaction-button[aria-pressed="true"] { border-color: var(--orange-500); color: #a94f00; background: var(--orange-100); }
.reaction-button[aria-pressed="true"] svg { fill: currentColor; }
.save-button[aria-pressed="true"] { border-color: var(--green-700); color: var(--green-800); background: var(--green-100); }
.action-hint { margin: 13px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 10px; }
.action-hint svg { width: 14px; }
.selection-note { margin-top: 16px; padding: 16px 17px; display: flex; gap: 12px; align-items: flex-start; color: #74420f; background: var(--orange-100); border: 1px solid #f8d5aa; border-radius: 19px; }
.selection-note > svg { width: 21px; flex: 0 0 auto; margin-top: 2px; color: var(--orange-500); }
.selection-note div { display: grid; gap: 3px; }
.selection-note strong { font-size: 12px; }
.selection-note span { color: #8d663d; font-size: 11px; line-height: 1.7; }

.bottom-nav { height: calc(78px + var(--safe-bottom)); padding: 8px 18px var(--safe-bottom); display: grid; grid-template-columns: 1fr 1fr; align-items: center; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); position: fixed; width: min(100%, 600px); left: 50%; transform: translateX(-50%); bottom: 0; z-index: 20; backdrop-filter: blur(18px); }
.nav-item { height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #849089; border-radius: 15px; font-size: 10px; font-weight: 800; }
.nav-item svg { width: 22px; }
.nav-item.is-active { color: var(--green-800); background: #f0f7f3; }
.nav-icon-wrap { position: relative; display: flex; }
.nav-icon-wrap b { min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; position: absolute; top: -8px; right: -11px; color: #fff; background: var(--orange-500); border: 2px solid #fff; border-radius: 999px; font-size: 8px; }

.saved-content { padding: 28px 20px 20px; }
.page-heading h1 { margin: 0; color: var(--green-950); font-size: 33px; }
.page-heading > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.saved-summary { margin-top: 22px; padding: 15px 17px; display: flex; align-items: center; justify-content: center; color: var(--green-800); background: var(--green-100); border-radius: 17px; font-size: 11px; }
.saved-summary strong { font-size: 18px; margin-left: 3px; }
.saved-list { margin-top: 14px; display: grid; gap: 11px; }
.saved-card { padding: 17px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 40px; align-items: center; gap: 12px; position: relative; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 8px 25px rgba(0,53,31,.055); }
.saved-order { width: 42px; height: 42px; display: grid; place-items: center; direction: ltr; color: var(--green-800); background: var(--green-100); border-radius: 14px; font-weight: 900; font-size: 12px; }
.saved-details { min-width: 0; }
.saved-details h2 { margin: 0; overflow: hidden; color: var(--green-950); font-size: 15px; line-height: 1.65; }
.saved-details p { margin: 5px 0 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.saved-details svg { width: 14px; }
.remove-save { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 13px; color: var(--muted); background: #f5f7f6; cursor: pointer; }
.remove-save:hover { color: var(--danger); background: #fff0ee; }
.remove-save svg { width: 19px; }
.liked-mark { position: absolute; top: 8px; left: 8px; color: var(--orange-500); }
.liked-mark svg { width: 13px; fill: currentColor; }
.saved-card.is-removing { opacity: 0; transform: translateX(-20px); transition: opacity .25s, transform .25s; }
.saved-empty { min-height: 410px; padding: 40px 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed #cbd8d0; border-radius: var(--radius-xl); background: rgba(255,255,255,.55); }
.saved-empty > span { width: 62px; height: 62px; display: grid; place-items: center; color: var(--green-700); background: var(--green-100); border-radius: 21px; }
.saved-empty > span svg { width: 28px; }
.saved-empty h2 { margin: 20px 0 7px; font-size: 20px; }
.saved-empty p { max-width: 330px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.saved-empty .primary-button { min-height: 49px; margin-top: 22px; font-size: 12px; }

.toast { max-width: calc(100vw - 32px); padding: 12px 16px; position: fixed; right: 50%; bottom: calc(92px + var(--safe-bottom)); z-index: 100; transform: translate(50%, 18px); color: #fff; background: var(--green-950); border-radius: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.2); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(50%, 0); }
.toast.is-error { background: var(--danger); }

@media (max-width: 900px) {
    .auth-shell { display: block; min-height: 100vh; min-height: 100dvh; background: var(--cream); }
    .auth-visual { min-height: 43vh; padding: calc(28px + env(safe-area-inset-top, 0px)) 24px 55px; border-radius: 0 0 34px 34px; }
    .auth-copy h1 { font-size: clamp(34px, 10vw, 50px); }
    .auth-copy > p:last-child { display: none; }
    .journey-step { max-width: 220px; }
    .auth-card { width: calc(100% - 28px); margin: -28px auto 0; padding: 28px 24px 38px; position: relative; z-index: 3; border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
    .auth-logo { width: 112px; margin-bottom: 25px; }
    .auth-heading h2 { font-size: 26px; }
    .auth-logo { width: 112px; margin: 0 auto 25px; }
}

/* گوشی در حالت افقی: بلوکِ سبزِ بالا نصفِ صفحه رو می‌گرفت و فرم زیرِ خطِ
   دید می‌افتاد. */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
    .auth-visual { min-height: 0; padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 34px; }
    .auth-copy h1 { font-size: 26px; }
    .journey-step { display: none; }
    .auth-card { margin-top: -22px; padding: 22px 22px 30px; }
    .auth-logo { width: 92px; margin-bottom: 16px; }
    .auth-heading h2 { font-size: 21px; }
    .login-form { margin-top: 22px; }
    .input-wrap input { height: 50px; }
    .primary-button { min-height: 48px; margin-top: 18px; }
}

@media (max-width: 400px) {
    .app-header { padding-inline: 15px; }
    .mini-brand span { display: none; }
    .live-content, .saved-content { padding-inline: 14px; }
    .live-hero, .idea-card { border-radius: 24px; }
    .idea-card { padding: 20px; }
    .member-menu > div { display: none; }
}

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