/* ══════════════════════════════════════════════════════════════════
   S2CC Custom Checkout v1.7.0
   Single-form architecture. Colors via CSS custom properties.
   Defaults: bg #141414, accent #DF2027, text #F5F5F5
   ══════════════════════════════════════════════════════════════════ */

.s2cc-checkout-wrap {
    font-family: var(--s2cc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
    max-width: 580px;
    margin: 0 auto;
    color: var(--s2cc-text, #F5F5F5);
}
.s2cc-checkout-wrap *, .s2cc-checkout-wrap *::before, .s2cc-checkout-wrap *::after { box-sizing: border-box; }

/* Accordion steps hidden until JS is done relocating form fields */
.s2cc-checkout-wrap .s2cc-accordion-step { opacity: 0; transition: opacity 0.2s ease-in; }
.s2cc-checkout-wrap.s2cc-ready .s2cc-accordion-step { opacity: 1; }
.s2cc-checkout-wrap.s2cc-ready .s2cc-loading { display: none; }

/* ── Loading Spinner ────────────────────────────────────────────── */
.s2cc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 20px;
    color: var(--s2cc-text, #aaa);
    font-size: 14px;
    font-weight: 500;
}

.s2cc-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: var(--s2cc-accent, #DF2027);
    border-radius: 50%;
    animation: s2cc-spin 0.7s linear infinite;
}

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

/* Hide the raw s2member form source (we relocate its pieces) */
#s2cc-s2form-source { display: none !important; }

/* ── Accordion ───────────────────────────────────────────────────── */
.s2cc-accordion-step {
    background: #1c1c1c !important; background-color: #1c1c1c !important;
    border: 1px solid #2e2e2e !important;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: none !important;
}
.s2cc-accordion-step.s2cc-open {
    border-color: #383838 !important;
    box-shadow: none !important;
}
/* Locked steps (can't open until previous step is done) */
.s2cc-accordion-step.s2cc-locked .s2cc-accordion-header {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}
.s2cc-accordion-step.s2cc-done .s2cc-step-badge { background: #16a34a !important; }

.s2cc-accordion-header {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 16px 18px;
    background: transparent !important; border: none !important;
    color: #F5F5F5 !important;
    font-size: 15px; font-weight: 600; cursor: pointer; text-align: left;
    transition: color 0.2s, background 0.2s;
    margin: 0; border-radius: 0;
    /* Reset any Elementor inherited styles on divs */
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    user-select: none;
}
.s2cc-accordion-step.s2cc-open .s2cc-accordion-header {
    background: rgba(245, 245, 245, 0.03) !important;
}
/* Hover uses accent color */
.s2cc-accordion-header:hover {
    color: var(--s2cc-accent, #DF2027); filter: brightness(0.85);
}
.s2cc-accordion-header:hover .s2cc-step-title {
    color: var(--s2cc-accent, #DF2027); filter: brightness(0.85);
}

.s2cc-step-badge {
    width: 26px; height: 26px; border-radius: 50%;
    background: #333333 !important; color: #F5F5F5 !important;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
    border: 1px solid #F5F5F5 !important;
}
.s2cc-step-title { flex: 1; transition: color 0.2s; }
/* ── Selection summary (shown when Step 1 is collapsed/done) ──────── */
.s2cc-selection-summary {
    display: none;
    padding: 10px 18px 14px;
    margin-top: -4px;
}
.s2cc-accordion-step.s2cc-done:not(.s2cc-open) .s2cc-selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.s2cc-sel-label {
    font-size: 14px;
    font-weight: 500;
    color: #F5F5F5;
    padding-left: 38px; /* align with title text (badge width + gap) */
}
.s2cc-sel-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--s2cc-accent, #DF2027);
    white-space: nowrap;
}
.s2cc-sel-price small {
    font-weight: 400;
    font-size: 11px;
    opacity: 0.6;
}
.s2cc-chevron {
    color: var(--s2cc-text, #F5F5F5); opacity: 0.4;
    transition: transform 0.3s, color 0.2s; flex-shrink: 0;
}
.s2cc-accordion-header:hover .s2cc-chevron { color: var(--s2cc-accent, #DF2027); filter: brightness(0.85); opacity: 0.8; }
.s2cc-accordion-step.s2cc-open .s2cc-chevron { transform: rotate(180deg); opacity: 1; }

.s2cc-accordion-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 18px;
}
.s2cc-accordion-step.s2cc-open .s2cc-accordion-body {
    max-height: 3000px; padding: 0 18px 18px;
}

/* ── Package Cards ───────────────────────────────────────────────── */
.s2cc-packages { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.s2cc-package-card {
    display: block; cursor: pointer;
    border: 1px solid var(--s2cc-text, #F5F5F5);
    border-radius: 8px; padding: 12px 14px;
    transition: all 0.2s; background: transparent;
}
.s2cc-package-card:hover {
    border-color: var(--s2cc-text, #F5F5F5);
    background: rgba(245, 245, 245, 0.05);
}
.s2cc-package-card.s2cc-selected {
    border-color: var(--s2cc-accent, #DF2027);
    border-width: 2px;
    padding: 11px 13px;
    background: rgba(223, 32, 39, 0.06);
}
.s2cc-package-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.s2cc-card-inner { display: flex; align-items: center; gap: 12px; }
.s2cc-card-radio {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--s2cc-text, #F5F5F5);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: border-color 0.2s;
}
.s2cc-radio-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--s2cc-accent, #DF2027);
    transform: scale(0); transition: transform 0.15s;
}
.s2cc-selected .s2cc-card-radio { border-color: var(--s2cc-accent, #DF2027); }
.s2cc-selected .s2cc-radio-dot { transform: scale(1); }

.s2cc-card-label { flex: 1; font-weight: 600; font-size: 14px; color: var(--s2cc-text); }
.s2cc-card-meta { text-align: right; flex-shrink: 0; }
.s2cc-card-price { display: block; font-weight: 700; font-size: 15px; color: var(--s2cc-accent, #DF2027); }
.s2cc-card-price small { font-weight: 400; font-size: 11px; opacity: 0.6; }
.s2cc-card-length { display: block; font-size: 11px; opacity: 0.5; }

/* ── Buttons (Continue, Continue to Payment) — filled red, right-aligned ── */
.s2cc-btn {
    display: inline-block !important; width: auto !important; margin-top: 20px !important;
    padding: 14px 32px !important; border: none !important; border-radius: 8px !important;
    font-size: 16px !important; font-weight: 600 !important; cursor: pointer !important;
    transition: background 0.2s, transform 0.1s !important;
    -webkit-appearance: none !important; appearance: none !important;
    line-height: 1.4 !important;
    float: right !important;
}
.s2cc-btn-next {
    background: var(--s2cc-accent, #DF2027) !important; color: #fff !important;
}
.s2cc-btn-next:hover { background: var(--s2cc-accent, #DF2027) !important; filter: brightness(0.85); }
.s2cc-btn-next:active { transform: scale(0.98) !important; }
.s2cc-btn-next:focus { outline: none !important; box-shadow: none !important; }

/* Clear float after button so accordion body doesn't collapse */
.s2cc-accordion-body::after {
    content: ''; display: table; clear: both;
}

/* ── Logged-in notice ────────────────────────────────────────────── */
.s2cc-logged-in-notice {
    background: rgba(22, 163, 74, 0.12); border: 1px solid rgba(22, 163, 74, 0.25);
    border-radius: 6px; padding: 10px 14px; font-size: 13px; color: #4ade80; margin-bottom: 12px;
}

/* ══════════════════════════════════════════════════════════════════
   s2Member Form Overrides
   ══════════════════════════════════════════════════════════════════ */

/* General form reset */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"],
.s2cc-checkout-wrap #s2member-pro-stripe-checkout-form {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--s2cc-text) !important;
}

/* All text elements */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] *:not(input):not(select):not(textarea):not(button) {
    color: var(--s2cc-text, #F5F5F5) !important;
}

/* Section containers — kill all borders (but NOT our accordion steps) */
.s2cc-checkout-wrap [id*="s2member-pro-stripe-checkout-form-section"]:not(.s2cc-accordion-step),
#s2cc-payment-slot [id*="section"]:not(.s2cc-accordion-step) {
    border: none !important; padding: 0 !important; margin: 0 0 10px !important; background: transparent !important;
}
/* Remove any hr or border elements s2member adds */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] hr {
    display: none !important;
}

/* Section titles (CREATE PROFILE, BILLING INFO, BILLING METHOD, etc) */
.s2cc-checkout-wrap [class*="section-title"],
#s2cc-checkout [class*="section-title"],
.s2cc-checkout-wrap .s2member-pro-stripe-form-section-title,
#s2cc-checkout .s2member-pro-stripe-form-section-title {
    font-family: var(--s2cc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif) !important;
    font-size: 12px !important; font-weight: 600 !important; text-transform: uppercase !important;
    letter-spacing: 0.5px !important; color: #F5F5F5 !important;
    border-bottom: 1px solid #333 !important;
    padding-bottom: 6px !important; margin-bottom: 10px !important; opacity: 0.7;
    background: transparent !important;
    font-variant: normal !important; /* override small-caps */
}

/* Labels — match font */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] label {
    color: var(--s2cc-text) !important; font-size: 13px !important;
    font-family: var(--s2cc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif) !important;
}

/* Coupon section spacing */
.s2cc-checkout-wrap #s2member-pro-stripe-checkout-form-coupon-section,
.s2cc-checkout-wrap [id*="checkout-form-coupon-section"] {
    margin-bottom: 4px !important;
    padding-bottom: 0 !important;
    border: none !important;
}
/* All non-submit buttons in the form (Apply, etc) — right-aligned */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="button"],
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] button:not([type="submit"]) {
    background: var(--s2cc-accent, #DF2027) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important; padding: 10px 20px !important;
    font-size: 13px !important; font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s;
    float: right !important;
    margin-top: 6px !important;
    margin-bottom: 2px !important;
}
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="button"]:hover,
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] button:not([type="submit"]):hover {
    background: var(--s2cc-accent, #DF2027) !important; filter: brightness(0.85);
}

/* Inputs & selects — force dark bg with max specificity */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="text"],
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="email"],
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="password"],
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="tel"],
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] select,
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] textarea,
.s2cc-checkout-wrap input[type="text"],
.s2cc-checkout-wrap input[type="email"],
.s2cc-checkout-wrap input[type="password"],
.s2cc-checkout-wrap input[type="tel"],
.s2cc-checkout-wrap select,
.s2cc-checkout-wrap textarea,
#s2cc-checkout input[type="text"],
#s2cc-checkout input[type="email"],
#s2cc-checkout input[type="password"],
#s2cc-checkout input[type="tel"],
#s2cc-checkout select,
#s2cc-checkout textarea {
    width: 100% !important; padding: 10px 12px !important;
    background: #1e1e1e !important; background-color: #1e1e1e !important;
    color: #F5F5F5 !important;
    border: 1px solid #333 !important;
    border-radius: 6px !important; font-size: 14px !important;
    -webkit-appearance: none !important;
}
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input:focus,
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] select:focus,
#s2cc-checkout input:focus,
#s2cc-checkout select:focus {
    border-color: var(--s2cc-accent, #DF2027) !important; outline: none !important;
    box-shadow: 0 0 0 3px rgba(223, 32, 39, 0.15) !important;
}
/* Password strength meter */
.s2cc-checkout-wrap [id*="password-strength"],
#s2cc-checkout [id*="password-strength"] {
    background: #333 !important; color: #F5F5F5 !important;
    border-radius: 4px !important;
}

/* ── HIDE the checkout options dropdown entirely ──────────────────── 
   User already picked their package in step 1. Only target the
   amount select and its specific section wrapper. */
.s2cc-checkout-wrap select[id*="s2member-pro-stripe-checkout-form-amount"] {
    display: none !important;
}
/* The section wrapper that contains the dropdown */
.s2cc-checkout-wrap div[id*="s2member-pro-stripe-checkout-form-options-section"] {
    display: none !important;
}

/* Hide the description line */
.s2cc-checkout-wrap [id*="checkout-form-description"],
.s2cc-checkout-wrap [class*="checkout-form-description"] {
    display: none !important;
}

/* ── HIDE the response/notice box at top (the weird shaded box) ─── 
   This is the s2member response area that shows before interaction.
   Only show it when it actually contains a message (JS handles). */
.s2cc-checkout-wrap [id*="s2member-pro-stripe-checkout-form-response"] {
    display: none !important;
}
/* Show when it has actual content (error/success/discount message) */
.s2cc-checkout-wrap [id*="s2member-pro-stripe-checkout-form-response"].s2cc-has-message,
#s2cc-checkout [id*="response"].s2cc-has-message {
    display: block !important;
    background: #1a2e1a !important; background-color: #1a2e1a !important;
    border: 1px solid #2d5a2d !important;
    border-radius: 6px !important; padding: 12px 16px !important;
    color: #86efac !important; margin-bottom: 12px !important;
    font-size: 14px !important; line-height: 1.5 !important;
}
/* ALL children inside response — force dark green theme */
.s2cc-checkout-wrap [id*="response"].s2cc-has-message *,
#s2cc-checkout [id*="response"].s2cc-has-message * {
    background: transparent !important; background-color: transparent !important;
    color: #86efac !important;
    border: none !important;
}
.s2cc-checkout-wrap [id*="response"].s2cc-has-message strong,
.s2cc-checkout-wrap [id*="response"].s2cc-has-message b,
#s2cc-checkout [id*="response"].s2cc-has-message strong,
#s2cc-checkout [id*="response"].s2cc-has-message b {
    color: #4ade80 !important;
}

/* Stripe Element — card input */
.s2cc-checkout-wrap .StripeElement,
.s2cc-checkout-wrap [id*="stripe-element"],
.s2cc-checkout-wrap [class*="stripe-card"] {
    background: var(--s2cc-field-bg, #1e1e1e) !important;
    border: 1px solid var(--s2cc-border, #333) !important;
    border-radius: 6px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
}
/* The actual Stripe iframe inside */
.s2cc-checkout-wrap .StripeElement iframe,
.s2cc-checkout-wrap [id*="card-element"] iframe {
    width: 100% !important;
    min-height: 20px !important;
}
/* The div wrapping the Stripe element — ensure full width */
.s2cc-checkout-wrap [id*="card-element"],
.s2cc-checkout-wrap [id*="s2member-pro-stripe-checkout-form-card-element"] {
    width: 100% !important;
    margin-top: 6px !important;
}

/* Stripe "powered by" badge — add spacing */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] [id*="billing-method"] a,
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] a[href*="stripe.com"] {
    margin-top: 6px !important;
    display: inline-block !important;
}

/* Checkbox validation error */
.s2cc-checkbox-error {
    outline: 2px solid var(--s2cc-accent, #DF2027) !important;
    outline-offset: 4px;
    border-radius: 4px;
    transition: outline 0.2s ease;
}

.s2cc-checkbox-msg {
    background: var(--s2cc-accent, #DF2027);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

/* Billing method section spacing */
.s2cc-checkout-wrap [id*="billing-method-section"],
.s2cc-checkout-wrap [id*="billing-section"] {
    padding-top: 8px !important;
}

/* ── Submit button — right-aligned ────────────────────────────────── */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="submit"],
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] button[type="submit"],
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="image"] {
    display: inline-block !important; width: auto !important;
    padding: 14px 32px !important;
    background: var(--s2cc-accent, #DF2027) !important;
    color: #fff !important;
    border: none !important; border-radius: 8px !important;
    font-size: 16px !important; font-weight: 600 !important;
    cursor: pointer !important; margin-top: 12px !important;
    -webkit-appearance: none !important; appearance: none !important;
    transition: background 0.2s, transform 0.1s;
    float: right !important;
}
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="submit"]:hover,
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] button[type="submit"]:hover {
    background: var(--s2cc-accent, #DF2027) !important; filter: brightness(0.85);
    filter: none !important;
}
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] input[type="submit"]:active,
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] button[type="submit"]:active {
    transform: scale(0.98);
}

/* (Apply button styles consolidated above in coupon section) */

/* ── All links inside form use accent color ───────────────────────── */
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] a,
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] a:visited {
    color: var(--s2cc-accent, #DF2027) !important;
}
.s2cc-checkout-wrap form[id*="s2member-pro-stripe"] a:hover {
    color: var(--s2cc-accent, #DF2027) !important;
    filter: brightness(1.2);
}

/* Error state */
.s2cc-error {
    background: rgba(220, 38, 38, 0.12); border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 6px; padding: 14px 18px; color: #fca5a5; font-size: 14px;
}

/* ── Success area (shown below collapsed accordions) ─────────────── */
#s2cc-success-area {
    margin-top: 12px;
}
#s2cc-success-area .s2cc-success-box {
    display: block !important;
    background: #1a2e1a !important;
    border: 1px solid #2d5a2d !important;
    border-radius: 10px !important;
    padding: 20px 24px !important;
    color: #86efac !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
}
#s2cc-success-area .s2cc-success-box * {
    background: transparent !important;
    color: #86efac !important;
    border: none !important;
}
#s2cc-success-area .s2cc-success-box strong,
#s2cc-success-area .s2cc-success-box b {
    color: #4ade80 !important;
}
.s2cc-success-link {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #2d5a2d;
}
.s2cc-success-link a {
    color: var(--s2cc-accent, #DF2027) !important;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
}
.s2cc-success-link a:hover {
    color: var(--s2cc-accent, #DF2027) !important; filter: brightness(0.85);
    text-decoration: underline;
}
.s2cc-redirect-msg {
    display: block;
    font-size: 13px;
    color: #86efac !important;
    margin-bottom: 8px;
    font-weight: 400;
}
.s2cc-redirect-msg strong {
    color: #4ade80 !important;
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .s2cc-checkout-wrap { max-width: 100%; }
    .s2cc-accordion-header { padding: 12px 14px; font-size: 14px; }
    .s2cc-accordion-step.s2cc-open .s2cc-accordion-body { padding: 0 14px 14px; }
    .s2cc-card-inner { flex-wrap: wrap; }
    .s2cc-card-meta { width: 100%; text-align: left; padding-left: 30px; }
    .s2cc-sel-label { font-size: 13px; padding-left: 38px; }
    .s2cc-sel-price { font-size: 14px; }
}

/* ── s2Member Stripe Submit Button Override ──────────
   Previously in child theme style.css.
   Uses global brand tokens via --s2cc-accent (set from WebTutors Settings). */
#s2member-pro-stripe-checkout-submit {
    background-color: var(--s2cc-accent, #DF2027) !important;
    border-color: var(--s2cc-accent, #DF2027) !important;
    background-image: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

#s2member-pro-stripe-checkout-submit:hover {
    background-color: var(--s2cc-accent, #b81a20) !important;
    border-color: var(--s2cc-accent, #b81a20) !important;
    background-image: none !important;
    box-shadow: none !important;
    transform: translateY(-1px);
    filter: brightness(0.85);
}

#s2member-pro-stripe-checkout-submit:focus,
#s2member-pro-stripe-checkout-submit:active,
#s2member-pro-stripe-checkout-submit.btn.btn-primary:hover,
#s2member-pro-stripe-checkout-submit.btn.btn-primary:focus,
#s2member-pro-stripe-checkout-submit.btn.btn-primary:active {
    background-color: var(--s2cc-accent, #b81a20) !important;
    border-color: var(--s2cc-accent, #b81a20) !important;
    background-image: none !important;
    box-shadow: none !important;
}

#s2member-pro-stripe-checkout-submit:focus {
    outline: none !important;
}
