/* Peptide Reconstitution Calculator
 * All rules are scoped under .peptide-calc so the reset and layout
 * styles do not leak into the rest of the WordPress page.
 */

.peptide-calc {
    /* Theme tokens */
    --bg-primary: #ffffff;
    --bg-card: #f8f9fc;
    --bg-input: #f0f2f7;
    --bg-input-hover: #e6e9f0;
    --border-color: #d0d5e0;
    --border-active: #1a6bca;
    --accent: #1a6bca;
    --accent-light: #2d7fe8;
    --accent-glow: rgba(26, 107, 202, 0.08);
    --accent-glow-strong: rgba(26, 107, 202, 0.15);
    --silver: #8c939e;
    --silver-light: #b0b7c3;
    --silver-border: #c5cbd6;
    --silver-bg: #eceef2;
    --text-primary: #111318;
    --text-secondary: #4a5060;
    --text-muted: #7a8292;
    --result-bg: #f0f5fc;
    --result-border: #1a6bca;
    --danger: #d93025;
    --warning: #b06000;
    --warning-bg: #fef7ec;
    --warning-border: #f0d6a0;
    --radius: 12px;
    --radius-sm: 8px;

    /* Layout (was the original body rule) */
    font-family: 'DM Sans', sans-serif;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;

    position: relative;
}

.peptide-calc *,
.peptide-calc *::before,
.peptide-calc *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* Two-column layout: "What you need" diagram on the left, calculator on the right. */
.peptide-calc .calc-layout {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2.5rem;
    width: 100%;
    max-width: 1080px;
}

.peptide-calc .calc-aside {
    flex: 0 0 340px;
    max-width: 340px;
    position: sticky;
    top: 1.5rem;
    margin-top: 100px;
}

.peptide-calc .calc-diagram {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.peptide-calc .calc-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.peptide-calc .page-container {
    max-width: 680px;
    width: 100%;
    position: relative;
}

@media (max-width: 900px) {
    .peptide-calc .calc-layout { flex-direction: column; align-items: center; gap: 2rem; }
    /* Tool first on small screens, diagram below. */
    .peptide-calc .calc-main { order: 1; width: 100%; }
    .peptide-calc .calc-aside { order: 2; position: static; flex-basis: auto; width: 100%; max-width: 420px; }
}

.peptide-calc .calc-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.peptide-calc .calc-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.peptide-calc .calc-header .brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #4a9af5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.peptide-calc .calc-header .brand-logo svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.peptide-calc .calc-header .brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.peptide-calc .calc-header .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--silver-bg);
    border: 1px solid var(--silver-border);
    color: var(--silver);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 50px;
    margin-bottom: 1.25rem;
}

/* Heading uses the site's heading font (Source Serif 4), matching the legal
   pages / compound profiles / thank-you page, instead of the calculator's own
   Outfit/DM Sans. The "Reconstitution" .blue accent is kept. */
.peptide-calc .calc-header h1 {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-weight: 700;
}

.peptide-calc .calc-header h1 .blue { color: var(--accent); }

.peptide-calc .calc-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto;
}

.peptide-calc .calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
}

.peptide-calc .calc-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--silver-light), var(--accent), var(--silver-light));
    border-radius: 20px 20px 0 0;
}

.peptide-calc .form-group {
    margin-bottom: 1.75rem;
}

.peptide-calc .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    letter-spacing: 0.01em;
}

.peptide-calc .form-group label .unit-hint {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

.peptide-calc .pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.peptide-calc .pill {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.peptide-calc .pill:hover {
    background: var(--bg-input-hover);
    border-color: var(--silver);
    color: var(--text-primary);
}

.peptide-calc .pill.active {
    background: var(--accent-glow-strong);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.peptide-calc .custom-input-row {
    display: none;
    margin-top: 10px;
    animation: slideDown 0.25s ease;
}

.peptide-calc .custom-input-row.visible { display: flex; gap: 8px; align-items: center; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.peptide-calc .custom-input-row input {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.peptide-calc .custom-input-row input::-webkit-inner-spin-button,
.peptide-calc .custom-input-row input::-webkit-outer-spin-button { -webkit-appearance: none; }

.peptide-calc .custom-input-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.peptide-calc .unit-toggle {
    display: inline-flex;
    background: var(--silver-bg);
    border: 1px solid var(--silver-border);
    border-radius: 50px;
    overflow: hidden;
    margin-left: 10px;
    vertical-align: middle;
}

.peptide-calc .unit-toggle button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.peptide-calc .unit-toggle button.active {
    background: var(--accent);
    color: #ffffff;
}

.peptide-calc .calc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(26,107,202,0.25);
}

.peptide-calc .calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(26,107,202,0.35);
}

.peptide-calc .calc-btn:active { transform: translateY(0); }

.peptide-calc .calc-btn svg { width: 20px; height: 20px; }

.peptide-calc .result-panel {
    display: none;
    margin-top: 2rem;
    background: var(--result-bg);
    border: 1px solid rgba(26,107,202,0.2);
    border-radius: var(--radius);
    padding: 2rem;
    animation: fadeUp 0.4s ease;
    position: relative;
    overflow: hidden;
}

.peptide-calc .result-panel.visible { display: block; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.peptide-calc .result-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.peptide-calc .result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.peptide-calc .result-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.peptide-calc .result-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.peptide-calc .result-item .value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.peptide-calc .result-item .value span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

.peptide-calc .result-item.highlight {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(26,107,202,0.06), rgba(26,107,202,0.12));
    border-color: rgba(26,107,202,0.3);
    text-align: center;
    padding: 1.25rem;
}

.peptide-calc .result-item.highlight .value {
    font-size: 2.2rem;
    color: var(--accent);
}

.peptide-calc .syringe-visual {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
}

.peptide-calc .syringe-visual .sv-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.peptide-calc .syringe-bar-track {
    width: 100%;
    height: 28px;
    background: var(--silver-bg);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--silver-border);
}

.peptide-calc .syringe-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 14px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.peptide-calc .syringe-bar-fill::after {
    content: '';
    position: absolute;
    top: 4px; bottom: 4px; right: 4px;
    width: 3px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
}

.peptide-calc .syringe-pct {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.peptide-calc .syringe-pct strong { color: var(--text-primary); }

.peptide-calc .syringe-image-wrap {
    display: none;
    width: 100%;
    margin: 0 auto;
}

.peptide-calc .syringe-visual.has-syringe-image .syringe-bar { display: none; }

.peptide-calc .syringe-visual.has-syringe-image .syringe-image-wrap { display: block; }

/* One set per syringe size; only the active size is shown. Column ratios
   match each set's piece pixel widths (tip / barrel / end). */
.peptide-calc .syringe-image-set {
    display: none;
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    align-items: center;
}

.peptide-calc .syringe-image-set.is-active { display: grid; }

.peptide-calc .syringe-image-set[data-syringe="0.3"] { grid-template-columns: 362fr 490fr 362fr; }

.peptide-calc .syringe-image-set[data-syringe="0.5"] { grid-template-columns: 361fr 626fr 332fr; }

.peptide-calc .syringe-image-set[data-syringe="1"] { grid-template-columns: 316fr 780fr 332fr; }

.peptide-calc .syringe-piece {
    display: block;
    width: 100%;
    height: auto;
}

.peptide-calc .syringe-barrel-wrap {
    position: relative;
    min-width: 0;
}

.peptide-calc .syringe-image-marker {
    position: absolute;
    top: 23%;
    bottom: 22%;
    width: 2px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(26,107,202,0.35);
    transform: translateX(-50%);
}

.peptide-calc .syringe-image-marker::before,
.peptide-calc .syringe-image-marker::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9);
    transform: translateX(-50%);
}

.peptide-calc .syringe-image-marker::before { top: 0; }

.peptide-calc .syringe-image-marker::after { bottom: 0; }

.peptide-calc .warning-msg {
    display: none;
    margin-top: 1rem;
    padding: 12px 16px;
    background: #fef2f1;
    border: 1px solid #f5c6c2;
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.85rem;
    line-height: 1.5;
}

.peptide-calc .warning-msg.visible { display: block; }

.peptide-calc .affiliate-cta {
    margin-top: 2.5rem;
    background: linear-gradient(135deg, #f8f9fc 0%, #eef1f8 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.peptide-calc .affiliate-cta::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--silver-light), var(--accent), var(--silver-light));
}

.peptide-calc .affiliate-cta h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.peptide-calc .affiliate-cta p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.peptide-calc .affiliate-cta .shop-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(26,107,202,0.2);
}

.peptide-calc .affiliate-cta .shop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(26,107,202,0.3);
}

.peptide-calc .disclaimer {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.peptide-calc .disclaimer strong { color: var(--warning); }

@media (max-width: 600px) {
    .peptide-calc .calc-card { padding: 1.5rem; }
    .peptide-calc .calc-header h1 { font-size: 1.8rem; }
    .peptide-calc .result-grid { grid-template-columns: 1fr; }
    .peptide-calc .result-item.highlight .value { font-size: 1.8rem; }
    .peptide-calc .affiliate-cta { padding: 1.5rem; }
    .peptide-calc .pill { padding: 8px 14px; font-size: 0.8rem; }
}
