@charset "UTF-8";
/**
 * EYEMAGINE - HubSpot Integration
 * Dashboard-first styling for canvas/configure.php
 * (design direction: redesign/configure-option-c-dashboard.html)
 */

:root {
    --ink: #242220;
    --ink-dim: #716b64;
    --ground: #fdfcfa;
    --panel: #ffffff;
    --line: #ece7e0;
    --accent: #e2622f;
    --accent-deep: #a8410f;
    --accent-tint: #fdf1ea;
    --ok-bg: #edf7f0;
    --ok-ink: #1f6b40;
    --ok-dot: #2f9c5f;
    --bad-bg: #fdeeec;
    --bad-ink: #a32b1c;
    --bad-dot: #d3452f;
    --disabled-bg: #f5f3f0;
}

@supports (color: oklch(64% 0.19 45)) {
    :root {
        --accent: oklch(64% 0.19 45);
        --accent-deep: oklch(46% 0.17 40);
        --accent-tint: oklch(96% 0.03 55);
        --ok-bg: oklch(96% 0.03 155);
        --ok-ink: oklch(42% 0.1 155);
        --ok-dot: oklch(62% 0.14 155);
        --bad-bg: oklch(96% 0.03 30);
        --bad-ink: oklch(45% 0.15 30);
        --bad-dot: oklch(60% 0.19 30);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ground);
}

body.cfg {
    color: var(--ink);
    font-family: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

body.cfg h1,
body.cfg h2,
body.cfg h3,
body.cfg h4,
body.cfg h5 {
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    margin: 0;
    color: var(--ink);
}

body.cfg a { color: var(--accent-deep); text-decoration: none; }
body.cfg a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- shell */

.cfg-shell { max-width: 1440px; margin: 0 auto; }

.cfg-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--ground);
    box-shadow: 0 4px 12px -6px transparent;
    transition: box-shadow .15s ease;
}

/* Border/shadow only appears once the page is scrolled — see the scroll
   listener in configure.php that toggles this class on .cfg-topbar. */
.cfg-topbar.is-scrolled {
    box-shadow: 0 4px 12px -6px rgba(36, 34, 32, .18);
}

.cfg-topbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 18px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cfg-brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.cfg-logo {
    display: block;
    width: 106px;
    height: 28px;
    flex: none;
}

.cfg-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.cfg-main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 32px 40px 100px;
}

.cfg-foot {
    max-width: 1040px;
    margin: 0 auto;
    padding: 28px 40px 48px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink-dim);
    font-size: 12.5px;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------- buttons */

.cfg-btn,
body.cfg input.eyebutton,
body.cfg input.eyebutton-blue,
body.cfg a.eyebutton,
body.cfg a.download-eyebutton {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: "Karla", system-ui, sans-serif;
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
}

.cfg-btn:hover,
body.cfg input.eyebutton:hover,
body.cfg input.eyebutton-blue:hover,
body.cfg a.eyebutton:hover {
    background: var(--accent-deep);
    color: #fff;
    text-decoration: none;
}

.cfg-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--accent-deep);
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.2;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--accent-deep);
    cursor: pointer;
    font-family: "Karla", system-ui, sans-serif;
    text-decoration: none;
}

.cfg-btn-outline:hover { background: var(--accent-tint); text-decoration: none; }

.cfg-btn-quiet {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--ink-dim);
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.2;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid var(--line);
    cursor: pointer;
    font-family: "Karla", system-ui, sans-serif;
    text-decoration: none;
}

.cfg-btn-quiet:hover { color: var(--ink); border-color: var(--ink-dim); text-decoration: none; }

/* ------------------------------------------------------- cards & pills */

.cfg-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
}

.cfg-card + .cfg-card { margin-top: 16px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 5px 12px 5px 10px;
    border-radius: 20px;
    background: var(--ok-bg);
    color: var(--ok-ink);
    text-align: left;
}

.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok-dot); flex: none; }

.pill.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill.bad .dot { background: var(--bad-dot); }

.pill.muted { background: var(--disabled-bg); color: var(--ink-dim); }
.pill.muted .dot { background: var(--ink-dim); }

/* The "Needs attention" pill in the topbar is a <button> (it jumps to the
   failing row in Sync Health below) — reset the browser's default button
   chrome so it still just looks like a pill. */
button.pill {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    font: inherit;
    cursor: pointer;
}
button.pill:hover { filter: brightness(0.95); }
button.pill:focus-visible { outline: 2px solid var(--bad-ink); outline-offset: 2px; }

/* --------------------------------------------------------------- stats */

.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.span-all { grid-column: 1 / -1; }

.cfg-stats { display: flex; flex-direction: column; gap: 16px; margin-bottom: 40px; }

.stat {
    background: var(--accent-tint);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-num {
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.stat-label { font-size: 12px; color: var(--ink-dim); font-weight: 600; }

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    /* Keeps the row clear of the sticky topbar when "Needs attention"
       scrolls it into view. */
    scroll-margin-top: 84px;
}

.status-row:last-child { border-bottom: none; }
.status-label { font-size: 13.5px; color: var(--ink-dim); font-weight: 500; }

/* Brief highlight so the row(s) "Needs attention" jumps to are obvious,
   not just scrolled-to. */
@keyframes cfg-flash {
    0%, 100% { background: transparent; }
    25% { background: var(--bad-bg); }
}

.status-row.cfg-flash {
    animation: cfg-flash 1.6s ease;
    border-radius: 8px;
}

/* ----------------------------------------------------------- accordion */

.cfg-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.cfg-section-head h3 { font-size: 16px; }
.cfg-section-note { font-size: 12.5px; color: var(--ink-dim); }

.acc {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    overflow: hidden;
    margin-bottom: 12px;
}

.acc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: "Karla", system-ui, sans-serif;
}

.acc-head:hover { background: #fcfbf9; }

.acc-head .a-title {
    font-family: "Manrope", system-ui, sans-serif;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--ink);
}

.acc-head .a-sub { font-size: 12px; color: var(--ink-dim); font-weight: 400; margin-top: 2px; }

.acc-body {
    padding: 0 22px 24px;
    display: none;
    flex-direction: column;
    gap: 18px;
}

.acc-body.open { display: flex; }

.chev { transition: transform .15s; flex: none; color: var(--ink-dim); }
.chev.open { transform: rotate(180deg); }

/* -------------------------------------------------------------- fields */

label,
.fld > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    gap: 3px;
    margin-bottom: 6px;
}

.req { color: var(--accent); }

.help { font-size: 12px; color: var(--ink-dim); margin: 5px 0 0; line-height: 1.5; }

input[type=text],
input[type=email],
input[type=number],
input[type=password] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: "Karla", system-ui, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
}

input[type=text]:focus,
input[type=email]:focus,
select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

input[readonly],
input[disabled] { background: var(--disabled-bg); color: var(--ink-dim); }

select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: "Karla", system-ui, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23716b64' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 32px;
}

/* compact stage picker used in the deal-stage grids */
.sp select {
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13px;
    background-position: right 10px center;
    padding-right: 28px;
}

.sp-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    gap: 3px;
    margin-bottom: 6px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--accent-tint);
    border-radius: 10px;
}

.toggle-row .t-label { font-size: 14px; font-weight: 700; color: var(--ink); }
.toggle-row .t-sub { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.toggle-row select { width: 150px; flex: none; }

.cfg-hint {
    font-size: 12.5px;
    color: var(--ink-dim);
    background: var(--disabled-bg);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0;
}

/* validation errors appended by displayValidationError() */
body.cfg p.err,
body.cfg .err {
    color: var(--bad-ink);
    font-size: 12.5px;
    font-weight: 600;
    margin: 6px 0 0;
}

/* --------------------------------------------------------- action bar */

.cfg-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    flex-wrap: wrap;
}

.cfg-actions .cfg-actions-msg {
    margin-right: auto;
    color: var(--bad-ink);
    font-weight: 700;
    font-size: 13px;
}

/* ------------------------------------------------------------- notices */

.cfg-notice {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.cfg-notice h2,
.cfg-notice h5 { font-size: 15px; margin-bottom: 4px; }
.cfg-notice p { margin: 0; color: var(--ink-dim); }
.cfg-notice.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad-ink); }
.cfg-notice.bad h2, .cfg-notice.bad h5 { color: var(--bad-ink); }
.cfg-notice.good { background: var(--ok-bg); border-color: transparent; color: var(--ok-ink); }
.cfg-notice.good h2, .cfg-notice.good h5 { color: var(--ok-ink); }

.cfg-centered { max-width: 560px; margin: 0 auto; }

/* ------------------------------ legacy fragments (payment.php, oauth,
   paypal_* messages) rendered inside the new shell ------------------- */

body.cfg .content {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}

body.cfg .content > .section + .section { margin-top: 18px; }
body.cfg .content h2 { font-size: 18px; margin-bottom: 10px; }
body.cfg .content h5 { font-size: 15px; margin-bottom: 6px; }
body.cfg .content p { margin: 0 0 10px; }

body.cfg .field { margin: 0 0 16px; }
body.cfg .field > .input { display: block; }
body.cfg .field label { width: auto; }
body.cfg .field label span { color: var(--accent); }
body.cfg .inputTxt { font-size: 12px; color: var(--ink-dim); margin: 0 0 6px; line-height: 1.5; }

body.cfg .eyebutton-block {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0 0;
}

body.cfg .flex-right { margin-left: auto; }
body.cfg .result { margin: 12px 0 0; }

body.cfg hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 860px) {
    .grid3 { grid-template-columns: repeat(2, 1fr); }
    .cfg-main { padding: 24px 20px 90px; }
    .cfg-topbar-inner, .cfg-foot { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 560px) {
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .toggle-row { flex-direction: column; align-items: stretch; }
    .toggle-row select { width: 100%; }
    .acc-head { padding: 16px; }
    .acc-body { padding: 0 16px 20px; }
    .status-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* legacy fragments nested inside an accordion section shed their own card */
body.cfg .acc-body .content {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

body.cfg .acc-body .content h2 { font-size: 15px; }

body.cfg .acc-body input.eyebutton-blue {
    background: #fff;
    color: var(--accent-deep);
    border: 1.5px solid var(--accent-deep);
    font-size: 13.5px;
    padding: 9px 18px;
}

body.cfg .acc-body input.eyebutton-blue:hover { background: var(--accent-tint); }

/* Chargebee trial / account-id form: two columns instead of one long stack */
body.cfg .trial-period form .section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 18px;
}

body.cfg .trial-period form .section > .eyebutton-block,
body.cfg .trial-period form .section > p { grid-column: 1 / -1; }

@media (max-width: 560px) {
    body.cfg .trial-period form .section { grid-template-columns: 1fr; }
}

/* hs:title / hs:script / hs:link are non-standard tags that HubSpot's
   canvas-app proxy strips server-side before serving the page inside its
   iframe. When this page is loaded directly (outside that proxy — e.g. in
   local testing, or if the proxy is ever bypassed) browsers don't recognize
   them and render hs:title's text content as visible page text. Hide them
   unconditionally so that never happens. */
hs\:title, hs\:script, hs\:link { display: none; }
