/* ═══════════════════════════════════════
   Stripe Membership — Front-end Styles
   ═══════════════════════════════════════ */

:root {
    --sm-primary: #4F46E5;
    --sm-primary-hover: #4338CA;
    --sm-danger: #DC2626;
    --sm-danger-hover: #B91C1C;
    --sm-success: #16A34A;
    --sm-warning: #D97706;
    --sm-gray-50: #F9FAFB;
    --sm-gray-100: #F3F4F6;
    --sm-gray-200: #E5E7EB;
    --sm-gray-300: #D1D5DB;
    --sm-gray-500: #6B7280;
    --sm-gray-700: #374151;
    --sm-gray-900: #111827;
    --sm-radius: 8px;
    --sm-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --sm-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* ── Layout ── */
.sm-form-wrap {
    max-width: 520px;
    margin: 2rem auto;
    background: #fff;
    border: 1px solid var(--sm-gray-200);
    border-radius: var(--sm-radius);
    padding: 2rem;
    box-shadow: var(--sm-shadow);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sm-form-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.sm-form-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--sm-gray-900);
}

.sm-plan-badge {
    display: inline-block;
    background: var(--sm-gray-100);
    color: var(--sm-primary);
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* ── Steps ── */
.sm-step-title {
    font-size: 1.1rem;
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--sm-gray-200);
    color: var(--sm-gray-700);
}

.sm-optional-badge {
    font-size: 0.75rem;
    background: var(--sm-gray-100);
    color: var(--sm-gray-500);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    vertical-align: middle;
}

/* ── Fields ── */
.sm-field {
    margin-bottom: 1rem;
}

.sm-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--sm-gray-700);
}

.sm-required {
    color: var(--sm-danger);
}

.sm-field input[type="text"],
.sm-field input[type="email"],
.sm-field input[type="password"],
.sm-field textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--sm-gray-300);
    border-radius: var(--sm-radius);
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    background: #fff;
    color: var(--sm-gray-900);
}

.sm-field input:focus,
.sm-field textarea:focus {
    outline: none;
    border-color: var(--sm-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.sm-field-error {
    color: var(--sm-danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.sm-field-row {
    display: flex;
    gap: 1rem;
}

.sm-field-row .sm-field {
    flex: 1;
}

/* ── Stripe Card Element ── */
.sm-card-element {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--sm-gray-300);
    border-radius: var(--sm-radius);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sm-card-element.StripeElement--focus {
    border-color: var(--sm-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.sm-card-element.StripeElement--invalid {
    border-color: var(--sm-danger);
}

/* ── Verification code input ── */
.sm-code-input {
    text-align: center;
    letter-spacing: 0.5em;
    font-size: 1.5rem !important;
    font-weight: 700;
    padding: 0.75rem !important;
}

/* ── Buttons ── */
.sm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--sm-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    text-decoration: none;
}

.sm-btn:active {
    transform: translateY(1px);
}

.sm-btn-primary {
    background: var(--sm-primary);
    color: #fff;
}

.sm-btn-primary:hover {
    background: var(--sm-primary-hover);
}

.sm-btn-outline {
    background: transparent;
    color: var(--sm-primary);
    border: 1px solid var(--sm-primary);
}

.sm-btn-outline:hover {
    background: rgba(79, 70, 229, 0.05);
}

.sm-btn-danger {
    background: var(--sm-danger);
    color: #fff;
}

.sm-btn-danger:hover {
    background: var(--sm-danger-hover);
}

.sm-btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.sm-full-width {
    width: 100%;
}

.sm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Step navigation ── */
.sm-step-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* ── Messages ── */
.sm-messages {
    margin-bottom: 1rem;
}

.sm-messages:empty {
    display: none;
}

.sm-msg {
    padding: 0.75rem 1rem;
    border-radius: var(--sm-radius);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.sm-msg-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.sm-msg-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.sm-msg-info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ── Checkbox ── */
.sm-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--sm-gray-700);
    cursor: pointer;
}

.sm-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

/* ── Footer ── */
.sm-form-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--sm-gray-500);
}

.sm-form-footer a {
    color: var(--sm-primary);
    font-weight: 600;
    text-decoration: none;
}

.sm-form-footer a:hover {
    text-decoration: underline;
}

.sm-resend-row {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--sm-gray-500);
}

.sm-resend-row a {
    color: var(--sm-primary);
    font-weight: 600;
    text-decoration: none;
}

/* ── Account page ── */
.sm-account-section {
    margin-bottom: 1.5rem;
}

.sm-account-section h3 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--sm-gray-200);
    color: var(--sm-gray-700);
}

.sm-account-table {
    width: 100%;
    border-collapse: collapse;
}

.sm-account-table th,
.sm-account-table td {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    text-align: left;
    vertical-align: top;
}

.sm-account-table th {
    width: 120px;
    font-weight: 600;
    color: var(--sm-gray-500);
}

.sm-account-table td {
    color: var(--sm-gray-900);
}

/* ── Badges ── */
.sm-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-left: 0.5rem;
}

.sm-badge-green {
    background: #DCFCE7;
    color: #166534;
}

.sm-badge-yellow {
    background: #FEF9C3;
    color: #854D0E;
}

.sm-badge-red {
    background: #FEF2F2;
    color: #991B1B;
}

/* ── Restricted notice ── */
.sm-restricted-notice {
    max-width: 520px;
    margin: 3rem auto;
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--sm-gray-50);
    border: 1px solid var(--sm-gray-200);
    border-radius: var(--sm-radius);
}

.sm-restricted-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.sm-restricted-notice h3 {
    margin: 0 0 0.5rem;
    color: var(--sm-gray-900);
}

.sm-restricted-notice p {
    color: var(--sm-gray-500);
    margin-bottom: 1rem;
}

.sm-restricted-notice .sm-btn {
    margin: 0.25rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .sm-form-wrap {
        margin: 1rem;
        padding: 1.25rem;
    }

    .sm-field-row {
        flex-direction: column;
        gap: 0;
    }
}
