/**
 * FILE: assets/css/frontend.css
 * Stripe Membership Lite — Premium Frontend Styles
 * Version: 5.0.0
 */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
    --sml-stripe: #6772e5;
    --sml-stripe-dk: #4a50c9;
    --sml-stripe-lt: #eeeffe;
    --sml-green: #00c48c;
    --sml-green-lt: #e6faf5;
    --sml-amber: #f59e0b;
    --sml-amber-lt: #fef3c7;
    --sml-red: #ef4444;
    --sml-red-lt: #fef2f2;
    --sml-ink: #0f0f14;
    --sml-ink2: #3a3a4a;
    --sml-ink3: #7a7a90;
    --sml-surface: #ffffff;
    --sml-surface2: #f7f7fa;
    --sml-border: rgba(0,0,0,0.08);
    --sml-r: 10px;
    --sml-r-sm: 7px;
    --sml-font: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
.sml-button-wrap,
.sml-notice,
.sml-summary,
.sml-btn,
.sml-error,
.sml-error-msg,
.sml-login-required,
.sml-price-note {
    font-family: var(--sml-font);
    box-sizing: border-box;
}

/* ── Main Button ────────────────────────────────────────────────────────────── */
.sml-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    background: var(--sml-stripe);
    color: #fff;
    border: 2px solid transparent;
    border-radius: var(--sml-r-sm);
    font-family: var(--sml-font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition:
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
    box-shadow: 0 2px 10px rgba(103,114,229,0.28);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.sml-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.18s;
}

.sml-btn:hover {
    background: var(--sml-stripe-dk);
    color: #fff;
    box-shadow: 0 4px 18px rgba(103,114,229,0.38);
    transform: translateY(-1px);
    text-decoration: none;
}

.sml-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 6px rgba(103,114,229,0.2);
}

.sml-btn:disabled,
.sml-btn[data-loading="1"] {
    background: #c5c7e2;
    border-color: transparent;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    color: rgba(255,255,255,0.75);
}

/* Outline variant */
.sml-btn--outline {
    background: transparent;
    color: var(--sml-stripe);
    border-color: var(--sml-stripe);
    box-shadow: none;
}

.sml-btn--outline:hover {
    background: var(--sml-stripe-lt);
    color: var(--sml-stripe-dk);
    border-color: var(--sml-stripe-dk);
    box-shadow: none;
    transform: translateY(-1px);
}

.sml-btn--outline:active {
    transform: scale(0.98);
}

/* Loading spinner inside button */
.sml-btn[data-loading="1"]::after {
    content: '';
    width: 13px; height: 13px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: rgba(255,255,255,0.9);
    border-radius: 50%;
    animation: sml-spin 0.7s linear infinite;
    margin-left: 4px;
}

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

/* ── Button wrapper ─────────────────────────────────────────────────────────── */
.sml-button-wrap {
    display: inline-block;
    margin: 10px 0;
}

.sml-price-note {
    font-size: 12px;
    color: var(--sml-ink3);
    margin: 6px 0 0;
    text-align: center;
    letter-spacing: 0.3px;
}

/* ── Error messages ─────────────────────────────────────────────────────────── */
.sml-error-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--sml-r-sm);
    font-size: 12.5px;
    font-family: var(--sml-font);
    padding: 8px 12px;
    margin: 8px 0 0;
    animation: sml-fadein 0.2s ease;
}

.sml-error-msg::before {
    content: '!';
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--sml-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sml-error {
    color: #dc2626;
    font-family: var(--sml-font);
    font-size: 13px;
    padding: 10px 14px;
    background: var(--sml-red-lt);
    border-radius: var(--sml-r-sm);
    border: 1px solid rgba(239,68,68,0.15);
}

.sml-login-required {
    font-family: var(--sml-font);
    font-size: 13.5px;
    color: var(--sml-ink2);
    padding: 14px 18px;
    background: var(--sml-stripe-lt);
    border-radius: var(--sml-r-sm);
    border: 1px solid rgba(103,114,229,0.2);
}

.sml-login-required a {
    color: var(--sml-stripe);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(103,114,229,0.4);
    transition: border-color 0.15s;
}

.sml-login-required a:hover {
    border-color: var(--sml-stripe);
}

/* ── Notices ────────────────────────────────────────────────────────────────── */
.sml-notice {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 28px 30px;
    border-radius: var(--sml-r);
    margin: 24px 0;
    position: relative;
    overflow: hidden;
    animation: sml-fadein 0.3s ease;
}

@keyframes sml-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sml-notice--success {
    background: var(--sml-green-lt);
    border: 1px solid rgba(0,196,140,0.2);
    color: #004d3a;
}

.sml-notice--success::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--sml-green);
    border-radius: var(--sml-r) 0 0 var(--sml-r);
}

.sml-notice--warning {
    background: var(--sml-amber-lt);
    border: 1px solid rgba(245,158,11,0.2);
    color: #6d4c0a;
}

.sml-notice--warning::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--sml-amber);
    border-radius: var(--sml-r) 0 0 var(--sml-r);
}

.sml-notice--cancel {
    background: var(--sml-red-lt);
    border: 1px solid rgba(239,68,68,0.15);
    color: #7f1d1d;
}

.sml-notice--cancel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--sml-red);
    border-radius: var(--sml-r) 0 0 var(--sml-r);
}

.sml-notice__icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.sml-notice__body {
    flex: 1;
}

.sml-notice__title {
    font-family: var(--sml-font);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0 0 8px;
    line-height: 1.3;
}

.sml-notice__body p {
    font-family: var(--sml-font);
    font-size: 13.5px;
    line-height: 1.65;
    margin: 6px 0;
}

/* ── Summary table ──────────────────────────────────────────────────────────── */
.sml-summary {
    width: 100%;
    max-width: 420px;
    border-collapse: collapse;
    margin: 16px 0 20px;
    background: rgba(255,255,255,0.6);
    border-radius: var(--sml-r-sm);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.07);
}

.sml-summary th,
.sml-summary td {
    padding: 10px 14px;
    font-family: var(--sml-font);
    font-size: 13px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sml-summary tr:last-child th,
.sml-summary tr:last-child td {
    border-bottom: none;
}

.sml-summary th {
    font-weight: 500;
    color: var(--sml-ink3);
    width: 130px;
    background: rgba(0,0,0,0.025);
}

.sml-summary td {
    font-weight: 500;
    color: var(--sml-ink);
}
