/*
 * v2.6.121 — Self-hosted checkout page styling.
 *
 * Brand palette inherited from the rest of the plugin:
 *   slate (text / borders): #1a2332 #6b7685 #e2e6ea
 *   gold (accent):          #c9a730 #fdf8e7
 *   green (success/checks): #3a7d1e #2d6118 #eef6e9
 */

.hb-checkout {
    --hb-c-slate-dark:  #1a2332;
    --hb-c-slate-mid:   #6b7685;
    --hb-c-slate-soft:  #e2e6ea;
    --hb-c-slate-bg:    #f4f6f8;
    --hb-c-gold:        #c9a730;
    --hb-c-gold-soft:   #fdf8e7;
    --hb-c-green:       #3a7d1e;
    --hb-c-green-dk:    #2d6118;
    --hb-c-green-soft:  #eef6e9;
    --hb-c-red:         #b91c1c;
    --hb-c-red-soft:    #fef2f2;
    --hb-c-white:       #ffffff;

    max-width: 480px;
    margin: 24px auto;
    padding: 0 16px;
    color: var(--hb-c-slate-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

/* Admin-only config warning */
.hb-checkout__config-warn {
    background: var(--hb-c-red-soft);
    border: 1px solid #fecaca;
    border-left: 4px solid var(--hb-c-red);
    color: var(--hb-c-red);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 13px;
}

/* Header */
.hb-checkout__header {
    text-align: center;
    margin-bottom: 18px;
}
.hb-checkout__heading {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--hb-c-slate-dark);
}
.hb-checkout__subheading {
    margin: 0;
    color: var(--hb-c-slate-mid);
    font-size: 15px;
}

/* Plan summary box — v2.6.131 redesign.
   Was: soft gold-to-white vertical gradient with a thin gold border (washed out, dated).
   Now: confident dark slate background, gold accent label, big white price.
   Reads as a premium pricing card — the visual anchor of the page. */
.hb-checkout__plan {
    background: var(--hb-c-slate-dark);
    border: none;
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 14px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(26, 35, 50, 0.18);
    position: relative;
    overflow: hidden;
}
/* A subtle gold accent strip at the top edge — kept thin and deliberate
   rather than a full background gradient. Gives the card a "premium tier"
   feel without looking soft. */
.hb-checkout__plan::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--hb-c-gold);
}
.hb-checkout__plan-skeleton {
    color: rgba(255, 255, 255, 0.65);
    font-style: italic;
    font-size: 13px;
}
.hb-checkout__plan-name {
    font-size: 12px;
    font-weight: 800;
    color: var(--hb-c-gold);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin: 0 0 6px;
}
.hb-checkout__plan-price {
    font-size: 40px;
    font-weight: 900;
    color: var(--hb-c-white);
    line-height: 1.05;
    margin: 0;
}
.hb-checkout__plan-price-interval {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-left: 4px;
}
.hb-checkout__plan-description {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
}
.hb-checkout__plan-discount {
    display: inline-block;
    margin: 12px 0 0;
    padding: 5px 11px;
    background: var(--hb-c-green);
    color: var(--hb-c-white);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* What's included checklist */
.hb-checkout__included {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}
.hb-checkout__included li {
    position: relative;
    padding: 6px 0 6px 32px;
    font-size: 14px;
    color: var(--hb-c-slate-dark);
}
.hb-checkout__included li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 6px;
    width: 22px;
    height: 22px;
    background: var(--hb-c-green-soft);
    color: var(--hb-c-green);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
}

/* Form */
.hb-checkout__form {
    background: var(--hb-c-white);
    border: 1px solid var(--hb-c-slate-soft);
    border-radius: 12px;
    padding: 20px;
}

.hb-checkout__row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.hb-checkout__row--two > .hb-checkout__field { flex: 1; }
.hb-checkout__row--city-state-zip > .hb-checkout__field--city  { flex: 2; }
.hb-checkout__row--city-state-zip > .hb-checkout__field--state { flex: 0 0 70px; }
.hb-checkout__row--city-state-zip > .hb-checkout__field--zip   { flex: 1; }

.hb-checkout__field {
    display: block;
    margin-bottom: 12px;
}
.hb-checkout__label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--hb-c-slate-mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.hb-checkout__optional {
    color: var(--hb-c-slate-mid);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.hb-checkout__hint {
    display: block;
    font-size: 11px;
    color: var(--hb-c-slate-mid);
    margin-top: 4px;
    font-style: italic;
}

/* Inputs */
.hb-checkout__field input[type="text"],
.hb-checkout__field input[type="email"],
.hb-checkout__field input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1.5px solid var(--hb-c-slate-soft);
    border-radius: 8px;
    font-size: 15px;
    color: var(--hb-c-slate-dark);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}
.hb-checkout__field input:focus {
    outline: none;
    border-color: var(--hb-c-gold);
    box-shadow: 0 0 0 3px rgba(201, 167, 48, 0.18);
}
.hb-checkout__field input::placeholder {
    color: #b0b8c1;
}

/* Promo code Apply row + result line — v2.6.131 */
.hb-checkout__promo-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.hb-checkout__promo-row input[type="text"] {
    flex: 1;
}
.hb-checkout__apply {
    padding: 0 18px;
    background: var(--hb-c-slate-dark);
    color: var(--hb-c-white);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    transition: background .15s;
    white-space: nowrap;
    min-width: 78px;
}
.hb-checkout__apply:hover:not(:disabled) { background: #0f1a2c; }
.hb-checkout__apply:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.hb-checkout__promo-result {
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.45;
}
.hb-checkout__promo-result--ok {
    background: var(--hb-c-green-soft);
    color: var(--hb-c-green-dk);
    border-left: 3px solid var(--hb-c-green);
}
.hb-checkout__promo-result--err {
    background: var(--hb-c-red-soft);
    color: var(--hb-c-red);
    border-left: 3px solid var(--hb-c-red);
}
.hb-checkout__promo-result-strong { font-weight: 800; }
.hb-checkout__promo-result-was {
    color: var(--hb-c-slate-mid);
    text-decoration: line-through;
    margin-left: 4px;
    font-size: 12px;
}

/* Recurly.js card element holder */
.hb-checkout__card {
    border: 1.5px solid var(--hb-c-slate-soft);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    min-height: 44px;
    transition: border-color .15s, box-shadow .15s;
}
.hb-checkout__card.is-focus {
    border-color: var(--hb-c-gold);
    box-shadow: 0 0 0 3px rgba(201, 167, 48, 0.18);
}
.hb-checkout__card.is-invalid {
    border-color: var(--hb-c-red);
}

/* Error region */
.hb-checkout__error {
    background: var(--hb-c-red-soft);
    border: 1px solid #fecaca;
    border-left: 4px solid var(--hb-c-red);
    color: var(--hb-c-red);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}

/* Submit button */
.hb-checkout__submit {
    width: 100%;
    padding: 14px 16px;
    background: var(--hb-c-green);
    color: var(--hb-c-white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    margin-top: 6px;
    transition: background .15s, transform .05s;
}
.hb-checkout__submit:hover:not(:disabled)  { background: var(--hb-c-green-dk); }
.hb-checkout__submit:active:not(:disabled) { transform: translateY(1px); }
.hb-checkout__submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}
.hb-checkout__submit-price {
    font-weight: 800;
    opacity: 0.9;
}

.hb-checkout__legal {
    font-size: 11px;
    color: var(--hb-c-slate-mid);
    margin: 12px 0 0;
    text-align: center;
    line-height: 1.45;
}

/* Success state */
.hb-checkout__success {
    background: var(--hb-c-white);
    border: 1px solid var(--hb-c-green-soft);
    border-top: 4px solid var(--hb-c-green);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
}
.hb-checkout__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    background: var(--hb-c-green-soft);
    color: var(--hb-c-green);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
}
.hb-checkout__success h2 {
    margin: 0 0 8px;
    color: var(--hb-c-green-dk);
    font-size: 24px;
    font-weight: 800;
}
.hb-checkout__success p {
    margin: 0 0 8px;
    color: var(--hb-c-slate-dark);
    font-size: 15px;
}
.hb-checkout__redirect-note {
    color: var(--hb-c-slate-mid);
    font-size: 13px;
}

/* "Already subscribed" state — mirrors the success styling */
.hb-checkout--already-subscribed {
    text-align: center;
    background: var(--hb-c-white);
    border: 1px solid var(--hb-c-green-soft);
    border-top: 4px solid var(--hb-c-green);
    border-radius: 12px;
    padding: 32px 24px;
}
.hb-checkout--already-subscribed h2 {
    margin: 0 0 8px;
    color: var(--hb-c-green-dk);
    font-size: 22px;
    font-weight: 800;
}
.hb-checkout--already-subscribed .hb-checkout__btn {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 18px;
    background: var(--hb-c-green);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: background .15s;
}
.hb-checkout--already-subscribed .hb-checkout__btn:hover {
    background: var(--hb-c-green-dk);
}

/* Tighter on narrow screens */
@media (max-width: 380px) {
    .hb-checkout__row { flex-direction: column; gap: 0; }
    .hb-checkout__row--city-state-zip > .hb-checkout__field--state { flex: 1; }
}
