/* ============================================================
   Stripe Embedded Checkout - Theme Redesign (DM Sans / Brand Blue)
   ============================================================ */

/* Google Fonts injection for DM Sans */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Roboto:wght@400;500;700&display=swap');

:root {
    --brand-blue:        #2536EB;
    --brand-blue-dark:   #1a28b8;
    --brand-blue-light:  #3d4ef0;
    --bg-primary:        #ffffff;
    --bg-secondary:      #f8f9fa;
    --bg-tertiary:       #f3f4f6;
    --text-primary:      #1f2937;
    --text-secondary:    #6b7280;
    --text-tertiary:     #9ca3af;
    --border-color:      #e5e7eb;
    --border-hover:      #d1d5db;
    --success-color:     #22c55e;
    --error-color:       #ef4444;
    --warning-color:     #f59e0b;
    --shadow-sm:         0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md:         0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg:         0 10px 25px -3px rgb(0 0 0 / 0.1);
    --shadow-xl:         0 20px 40px -5px rgb(0 0 0 / 0.15);
}

/* ========== Form Container ========== */
.sec-form-container {
    max-width: 100%;
    margin: 48px auto;
    padding: 0 24px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sec-membership-form-wrapper {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.sec-form-header {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-light) 100%);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
}

.sec-form-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    font-family: 'DM Sans', sans-serif;
}

.sec-form-header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.95;
    line-height: 1.5;
}

.sec-pricing-preview {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sec-pricing-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.sec-pricing-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.product-image {
    width: 64px;
    height: 64px;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.product-image .product-logo {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    display: block;
}

.checkout-element {
    background-color: var(--bg-primary) !important;
}

.quantity-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--error-color);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Form ========== */
.sec-contact-form {
    padding: 2rem;
}

.sec-form-row {
    margin-bottom: 1.25rem;
}

.sec-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sec-form-row-3col {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

.sec-form-group {
    display: flex;
    flex-direction: column;
}

.sec-form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: 'DM Sans', sans-serif;
}

.sec-required {
    color: var(--error-color);
}

.sec-form-group input {
    padding: 0.875rem 1rem;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.sec-form-group input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 54, 235, 0.1);
    background: var(--bg-primary);
}

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

.sec-form-group input.sec-input-error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* ========== Form Error ========== */
.sec-form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: none;
}

/* ========== Terms of Service Checkbox ========== */
.sec-tos-row {
    margin: 1.25rem 0 0.75rem;
}

.sec-tos-label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
    margin: 0;
    padding: 0;
}

.sec-tos-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0.125rem 0 0 0;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--brand-blue);
}

.sec-tos-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.sec-tos-text a {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.sec-tos-text a:hover {
    color: var(--brand-blue-dark);
    text-decoration: underline;
}

.sec-tos-label.sec-input-error {
    color: var(--error-color, #ef4444);
}

.sec-tos-label.sec-input-error .sec-tos-checkbox {
    outline: 2px solid var(--error-color, #ef4444);
    outline-offset: 2px;
}

.sec-tos-label.sec-input-error .sec-tos-text {
    color: var(--error-color, #ef4444);
}

/* ========== Submit Button ========== */
.sec-submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-top: 0.5rem;
}

.sec-submit-btn:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sec-submit-btn:active {
    transform: translateY(0);
}

.sec-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== Thank You Overlay ========== */
.sec-thankyou-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sec-thankyou-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sec-thankyou-container {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 3rem 2rem;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.sec-thankyou-overlay.active .sec-thankyou-container {
    transform: scale(1) translateY(0);
}

.sec-thankyou-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success-color), #10b981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
    font-weight: bold;
}

.sec-thankyou-container h2 {
    margin: 0 0 0.75rem 0;
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
}

.sec-thankyou-container p {
    margin: 0 0 2rem 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
}

.sec-thankyou-btn {
    padding: 0.875rem 2rem;
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.sec-thankyou-btn:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========== Loading Spinner ========== */
.sec-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: sec-spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

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

/* =====================================================
   ACTIVATION SLOTS BAR
   ===================================================== */

#sec-slot-bar {
    margin: 0 0 20px 0;
    font-family: 'DM Sans', sans-serif;
}

.sec-slot-bar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.sec-slot-pips {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.sec-slot-pip {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: background 0.4s ease, opacity 0.3s ease;
}

.sec-slot-pip--free  { background: var(--success-color); }
.sec-slot-pip--taken {
    background: #94a3b8;
    opacity: 0.45;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.sec-slot-label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    font-family: 'DM Sans', sans-serif;
}

.sec-slot-bar--ok   .sec-slot-bar-inner { background: #f0fdf4; border-color: #bbf7d0; }
.sec-slot-bar--ok   .sec-slot-label     { color: #166534; }
.sec-slot-bar--low  .sec-slot-bar-inner { background: #fffbeb; border-color: #fde68a; }
.sec-slot-bar--low  .sec-slot-label     { color: #92400e; }
.sec-slot-bar--low  .sec-slot-pip--free { background: var(--warning-color); }
.sec-slot-bar--full .sec-slot-bar-inner { background: #fef2f2; border-color: #fecaca; }
.sec-slot-bar--full .sec-slot-label     { color: #991b1b; }
.sec-slot-bar--full .sec-slot-pip--free { background: #f87171; }

/* =====================================================
   WAITLIST POPUP / OVERLAY
   ===================================================== */

.sec-waitlist-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.sec-waitlist-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sec-waitlist-container {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 3rem 2rem 2.25rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
    font-family: 'DM Sans', sans-serif;
}

.sec-waitlist-overlay.active .sec-waitlist-container {
    transform: scale(1) translateY(0);
}

.sec-waitlist-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.sec-waitlist-close:hover { color: var(--text-primary); }

.sec-waitlist-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    color: white;
}

.sec-waitlist-icon--success {
    background: linear-gradient(135deg, #34d399, #10b981);
    font-size: 1.75rem;
}

.sec-waitlist-title {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
}

.sec-waitlist-sub {
    margin: 0 0 1.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.sec-wl-row { margin-bottom: 0.75rem; }

.sec-wl-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sec-wl-input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 54, 235, 0.1);
}

.sec-wl-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.sec-wl-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-top: 0.25rem;
}

.sec-wl-btn:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sec-wl-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sec-waitlist-success-msg {
    font-size: 0.95rem;
    color: #166534;
    margin: 0.75rem 0 0;
    line-height: 1.6;
}

.sec-waitlist-fine {
    margin: 1.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* ========== Mobile Responsiveness ========== */
@media (max-width: 768px) {
    .sec-form-container { margin: 24px auto; padding: 0 16px; }
    .sec-membership-form-wrapper { border-radius: 12px; }
    .sec-form-header { padding: 1.75rem 1.25rem; }
    .sec-form-header h2 { font-size: 1.4rem; }
    .sec-contact-form { padding: 1.25rem; }
    .sec-form-row-2col, .sec-form-row-3col { grid-template-columns: 1fr; gap: 0; }
    .sec-form-row-2col .sec-form-group, .sec-form-row-3col .sec-form-group { margin-bottom: 1rem; }
    .sec-thankyou-container { padding: 2.25rem 1.5rem; }
    .sec-thankyou-container h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .sec-form-container { padding: 0 12px; margin: 16px auto; }
    .sec-form-header h2 { font-size: 1.2rem; }
    .sec-pricing-preview { flex-direction: column; gap: 4px; }
    .sec-submit-btn { font-size: 0.95rem; padding: 0.875rem 1.25rem; }
    .sec-waitlist-container { padding: 2.5rem 1.5rem 1.75rem; border-radius: 16px; }
    .sec-waitlist-title { font-size: 1.4rem; }
    .sec-slot-pips { gap: 4px; }
    .sec-slot-pip { width: 9px; height: 9px; }
}
