/* ============================================================
   PeptideRank — Clinical Design System
   Trustworthy, transparent, research-grade aesthetic
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* --- CSS Variables --- */
:root {
    /* Backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;
    --bg-card: #FFFFFF;

    /* Borders */
    --border: #E2E8F0;
    --border-strong: #CBD5E1;

    /* Text */
    --text-heading: #0F172A;
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    /* Brand — Teal */
    --accent: #0F766E;
    --accent-hover: #0D9488;
    --accent-light: #F0FDFA;
    --accent-dim: rgba(15, 118, 110, 0.08);

    /* Navy */
    --navy: #1E293B;
    --navy-dark: #0F172A;

    /* Status colors */
    --green: #059669;
    --green-light: #ECFDF5;
    --green-bg: rgba(5, 150, 105, 0.08);
    --yellow: #D97706;
    --yellow-light: #FFFBEB;
    --yellow-bg: rgba(217, 119, 6, 0.08);
    --orange: #EA580C;
    --orange-light: #FFF7ED;
    --orange-bg: rgba(234, 88, 12, 0.08);
    --red: #DC2626;
    --red-light: #FEF2F2;
    --red-bg: rgba(220, 38, 38, 0.08);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* --- Typography --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.mono { font-family: 'IBM Plex Mono', 'SF Mono', monospace; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* --- Layout --- */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

/* --- Navigation --- */
.site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

nav {
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.logo-mark {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.logo-mark svg {
    width: 100%;
    height: 100%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
    color: var(--text-heading);
    background: var(--bg-tertiary);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-cta {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: var(--bg-primary) !important;
    background: var(--accent) !important;
    padding: 8px 18px !important;
    border-radius: var(--radius-md) !important;
    transition: background 0.2s, transform 0.15s !important;
}

.nav-cta:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}

/* Premium nav button */
.nav-premium-btn {
    background: var(--accent) !important;
    color: var(--bg-primary) !important;
    padding: 6px 14px !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.nav-premium-btn:hover { background: var(--accent-hover) !important; }

.nav-account-btn {
    border: 1px solid var(--border) !important;
    padding: 6px 14px !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.82rem !important;
    color: var(--text-secondary) !important;
}

/* Language toggle */
.lang-toggle {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    letter-spacing: 0.5px;
}

.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* --- Footer --- */
.site-footer {
    background: var(--navy-dark);
    color: rgba(255, 255, 255, 0.6);
    margin-top: 80px;
}

.footer-inner {
    padding: 48px 0 32px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    max-width: 280px;
}

.footer-col h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-col a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 700px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .footer-bottom { flex-direction: column; gap: 8px; }
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(15, 118, 110, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    width: 100%;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Score / Data Colors --- */
.score-high { color: var(--green); }
.score-mid { color: var(--yellow); }
.score-low { color: var(--orange); }
.score-poor { color: var(--red); }

.bar {
    width: 80px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
}

.bar-fill.high { background: var(--green); }
.bar-fill.mid { background: var(--yellow); }
.bar-fill.low { background: var(--orange); }
.bar-fill.poor { background: var(--red); }

/* --- Score Badge --- */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 30px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    font-family: 'IBM Plex Mono', monospace;
}

.score-badge.high { background: var(--green-bg); color: var(--green); }
.score-badge.mid { background: var(--yellow-bg); color: var(--yellow); }
.score-badge.low { background: var(--orange-bg); color: var(--orange); }
.score-badge.poor { background: var(--red-bg); color: var(--red); }

/* --- Score Ring --- */
.score-ring {
    position: relative;
}

.score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring .bg-ring {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.score-ring .fg-ring {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.score-number {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number .num {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    line-height: 1;
}

.score-number .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* --- COA & Ship Badges --- */
.coa-badge {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.coa-badge.yes { background: var(--green-bg); color: var(--green); }
.coa-badge.no { background: var(--bg-tertiary); color: var(--text-muted); }

.ship-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.ship-badge.eu { background: var(--green-bg); color: var(--green); }
.ship-badge.intl { background: var(--yellow-bg); color: var(--yellow); }

/* --- Mini Bar (Table) --- */
.mini-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-bar .bar {
    width: 60px;
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.mini-bar .bar-fill {
    height: 100%;
    border-radius: 3px;
}

.mini-bar .val {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 24px;
}

/* --- Loading --- */
.loading {
    text-align: center;
    padding: 80px 0;
    color: var(--text-muted);
}

.loading .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* --- Alerts --- */
.error-msg {
    background: var(--red-light);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--red);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: none;
}

.success-msg {
    background: var(--green-light);
    border: 1px solid rgba(5, 150, 105, 0.2);
    color: var(--green);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: none;
}

/* --- Premium Badge --- */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Country Tags --- */
.country-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.country-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(15, 118, 110, 0.12);
}

/* --- Disclaimer --- */
.disclaimer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Responsive Helpers --- */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    nav { padding: 12px 0; }
    .nav-links { gap: 4px; }
}

@media (max-width: 500px) {
    .nav-links a:not(.nav-cta):not(.nav-premium-btn):not(.nav-account-btn) {
        display: none;
    }
}
