/* ============================================================
   Selpho — Peptide Advisor Page Styles
   ============================================================ */

:root {
    --brand:      #0d9488;
    --brand-dark: #0f766e;
    --brand-glow: rgba(13,148,136,0.14);
    --dark:       #0d1117;
    --dark-2:     #161b22;
    --bg:         #ffffff;
    --bg-2:       #f8fafb;
    --border:     rgba(0,0,0,0.07);
    --border-2:   rgba(0,0,0,0.11);
    --text-1:     #0f172a;
    --text-2:     #475569;
    --text-3:     #94a3b8;
    --radius:     14px;
    --shadow-sm:  0 1px 4px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg:  0 12px 40px rgba(0,0,0,0.13);
    --font:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-head:  'Poppins', sans-serif;
    --ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --peptide:    #7c3aed;
    --peptide-light: rgba(124,58,237,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-1);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── NAV ──────────────────────────────────────────────── */
.site-nav {
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}
.nav-brand-icon {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.8rem;
    box-shadow: 0 2px 8px var(--brand-glow);
    flex-shrink: 0;
}
.nav-brand-name {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.025em;
}
.nav-brand-name span { color: var(--brand); }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.nav-back {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-2);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-back:hover { color: var(--text-1); background: var(--bg-2); }
.nav-cta {
    font-size: 0.84rem;
    font-weight: 600;
    color: white;
    background: var(--brand);
    padding: 0.45rem 1rem;
    border-radius: 8px;
    transition: background 0.15s, box-shadow 0.15s;
    letter-spacing: -0.01em;
}
.nav-cta:hover { background: var(--brand-dark); box-shadow: 0 2px 12px var(--brand-glow); color: white; }

/* ── PAGE HEADER ──────────────────────────────────────── */
.peptide-header {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 40%, #ddd6fe 100%);
    border-bottom: 1px solid rgba(124,58,237,0.12);
    padding: 3.5rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.peptide-header::before {
    content: '';
    position: absolute;
    top: -60px; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 400px;
    background: radial-gradient(ellipse, rgba(124,58,237,0.1) 0%, transparent 65%);
    pointer-events: none;
}
.peptide-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(124,58,237,0.1);
    color: var(--peptide);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.85rem;
    border-radius: 99px;
    border: 1px solid rgba(124,58,237,0.2);
    margin-bottom: 1.25rem;
}
.peptide-header h1 {
    font-family: var(--font-head);
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 0.85rem;
}
.peptide-header h1 em { font-style: normal; color: var(--peptide); }
.peptide-header p {
    font-size: 1rem;
    color: var(--text-2);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.65;
}
.peptide-disclaimer-strip {
    margin-top: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(124,58,237,0.15);
    border-radius: 99px;
    padding: 0.35rem 1rem;
    font-size: 0.75rem;
    color: var(--text-3);
    font-weight: 500;
}
.peptide-disclaimer-strip i { color: var(--peptide); font-size: 0.7rem; }

/* ── MAIN LAYOUT ──────────────────────────────────────── */
.peptide-main {
    padding: 3rem 0 5rem;
}
.peptide-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ── INPUT PANEL ──────────────────────────────────────── */
.input-panel {
    position: sticky;
    top: 80px;
}
.input-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.input-card h2 {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}
.input-card .input-hint {
    font-size: 0.82rem;
    color: var(--text-3);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
.symptom-textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.85rem 1rem;
    font-family: var(--font);
    font-size: 0.88rem;
    color: var(--text-1);
    background: var(--bg-2);
    border: 1.5px solid var(--border-2);
    border-radius: 10px;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.6;
    outline: none;
}
.symptom-textarea:focus {
    border-color: var(--peptide);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
    background: white;
}
.symptom-textarea::placeholder { color: var(--text-3); }

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.875rem;
    padding: 0.75rem 1.25rem;
    background: var(--peptide);
    color: white;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
    letter-spacing: -0.01em;
}
.btn-submit:hover:not(:disabled) {
    background: #6d28d9;
    box-shadow: 0 4px 20px rgba(124,58,237,0.35);
    transform: translateY(-1px);
}
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.usage-bar {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-3);
    margin-bottom: 0.5rem;
}
.usage-label span:last-child { font-weight: 600; color: var(--text-2); }
.usage-track {
    height: 4px;
    background: var(--border-2);
    border-radius: 99px;
    overflow: hidden;
}
.usage-fill {
    height: 100%;
    background: var(--peptide);
    border-radius: 99px;
    transition: width 0.4s var(--ease);
}

.example-chips {
    margin-top: 1rem;
}
.example-chips-label {
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: 0.5rem;
}
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.chip {
    padding: 0.28rem 0.65rem;
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: 99px;
    font-size: 0.75rem;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}
.chip:hover {
    background: var(--peptide-light);
    border-color: rgba(124,58,237,0.3);
    color: var(--peptide);
}

/* ── RESULTS PANEL ────────────────────────────────────── */
.results-panel { min-height: 300px; }

.results-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    text-align: center;
    padding: 2rem;
}
.results-empty-icon {
    width: 64px; height: 64px;
    background: var(--peptide-light);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    color: var(--peptide);
    margin-bottom: 1.25rem;
}
.results-empty h3 {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}
.results-empty p {
    font-size: 0.875rem;
    color: var(--text-3);
    max-width: 300px;
    line-height: 1.6;
}

/* Loading state */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    gap: 1rem;
}
.loading-state.active { display: flex; }
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-2);
    border-top-color: var(--peptide);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p {
    font-size: 0.9rem;
    color: var(--text-3);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:0.6;} 50%{opacity:1;} }

/* Results content */
.results-content { display: none; }
.results-content.active { display: block; }

.results-intro {
    font-size: 0.925rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-2);
    border-radius: 10px;
    border-left: 3px solid var(--peptide);
}

.peptide-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.peptide-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.peptide-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(124,58,237,0.2);
}

.peptide-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}
.peptide-card-icon {
    width: 40px; height: 40px;
    background: var(--peptide-light);
    color: var(--peptide);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.peptide-card-title { flex: 1; }
.peptide-card-name {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}
.peptide-card-cat {
    display: inline-block;
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--peptide);
    background: var(--peptide-light);
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
}

.peptide-card-relevance {
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.peptide-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}
.peptide-tag-group label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: 0.4rem;
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.tag {
    padding: 0.22rem 0.6rem;
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: 99px;
    font-size: 0.73rem;
    color: var(--text-2);
}

.peptide-card-research {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-3);
    margin-bottom: 0.875rem;
}
.peptide-card-research i { color: #f59e0b; }

.peptide-card-considerations {
    font-size: 0.815rem;
    color: var(--text-2);
    line-height: 1.55;
    padding: 0.75rem 1rem;
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: 8px;
}
.peptide-card-considerations strong {
    color: #b45309;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.2rem;
}

/* Stack synergy note */
.stack-synergy {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(124,58,237,0.04) 0%, rgba(124,58,237,0.02) 100%);
    border: 1px solid rgba(124,58,237,0.12);
    border-radius: 10px;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.stack-synergy i {
    color: var(--peptide);
    font-size: 0.9rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.stack-synergy p {
    font-size: 0.855rem;
    color: var(--text-2);
    line-height: 1.6;
}

/* Disclaimer block */
.results-disclaimer {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.78rem;
    color: var(--text-3);
    line-height: 1.55;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}
.results-disclaimer i { color: var(--text-3); flex-shrink: 0; margin-top: 2px; }

/* Off-topic message */
.offtopic-msg {
    padding: 1.25rem;
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 10px;
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.6;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.offtopic-msg i { color: #f59e0b; flex-shrink: 0; margin-top: 2px; }

/* ── SIGNUP PROMPT BANNER ─────────────────────────────── */
.signup-banner {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border-radius: var(--radius);
    color: white;
    position: relative;
    overflow: hidden;
}
.signup-banner.visible { display: block; }
.signup-banner::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 65%);
}
.signup-banner-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}
.signup-banner-text h4 {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}
.signup-banner-text p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
}
.signup-banner-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.btn-signup-now {
    padding: 0.55rem 1.1rem;
    background: white;
    color: var(--brand-dark);
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.btn-signup-now:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transform: translateY(-1px);
    color: var(--brand-dark);
}
.btn-signup-dismiss {
    padding: 0.55rem 0.85rem;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.84rem;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-signup-dismiss:hover { background: rgba(255,255,255,0.22); }

/* ── CONVERSATION HISTORY ─────────────────────────────── */
.convo-history {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.convo-item {
    padding: 0.75rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.convo-item:hover {
    background: var(--peptide-light);
    border-color: rgba(124,58,237,0.2);
}
.convo-item-text {
    font-size: 0.82rem;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.convo-item-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-3);
    flex-shrink: 0;
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 900px) {
    .peptide-layout {
        grid-template-columns: 1fr;
    }
    .input-panel {
        position: static;
    }
}
@media (max-width: 520px) {
    .peptide-header { padding: 2.5rem 0 2rem; }
    .signup-banner-inner { flex-direction: column; }
    .signup-banner-actions { margin-left: 0; }
}
