/* ============================================================
   RetouchWP — account.css
   Styles for [retouch_account], [retouch_buy], and the
   credit balance bar in [retouch_editor].
   ============================================================ */

:root {
    --rwp-accent:       #4F6EF7;
    --rwp-accent-dark:  #3a57e0;
    --rwp-accent-light: #EEF1FE;
    --rwp-text:         #1A1D23;
    --rwp-muted:        #6B7280;
    --rwp-border:       #E2E5ED;
    --rwp-surface:      #FFFFFF;
    --rwp-radius:       12px;
    --rwp-shadow:       0 2px 12px rgba(0,0,0,.07);
}

/* ── Shared base ─────────────────────────────────────────── */
.rwp-account-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 680px;
    margin: 0 auto;
    padding: 8px 0 48px;
    color: var(--rwp-text);
    box-sizing: border-box;
}
.rwp-buy-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 0 48px;
    color: var(--rwp-text);
    box-sizing: border-box;
}
.rwp-account-wrap *, .rwp-buy-wrap * { box-sizing: border-box; }

/* ── Auth panel ──────────────────────────────────────────── */
.rwp-auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--rwp-border);
    margin-bottom: 0;
}
.rwp-auth-tab {
    padding: 11px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 15px;
    font-weight: 600;
    color: var(--rwp-muted);
    cursor: pointer;
    font-family: inherit;
    transition: color .18s, border-color .18s;
}
.rwp-auth-tab--active { color: var(--rwp-accent); border-bottom-color: var(--rwp-accent); }
.rwp-auth-panel-inner {
    background: var(--rwp-surface);
    border: 1px solid var(--rwp-border);
    border-top: none;
    border-radius: 0 0 var(--rwp-radius) var(--rwp-radius);
    padding: 28px;
    box-shadow: var(--rwp-shadow);
}
.rwp-auth-title { font-size: 20px; font-weight: 700; margin: 0 0 20px; }
.rwp-field { margin-bottom: 16px; }
.rwp-field label { display: block; font-size: 13px; font-weight: 600; color: var(--rwp-text); margin-bottom: 6px; }
.rwp-field-hint { font-weight: 400; color: var(--rwp-muted); }
.rwp-field input[type=text],
.rwp-field input[type=email],
.rwp-field input[type=password] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--rwp-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--rwp-text);
    transition: border-color .2s;
}
.rwp-field input:focus { outline: none; border-color: var(--rwp-accent); box-shadow: 0 0 0 3px rgba(79,110,247,.12); }
.rwp-remember-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--rwp-muted); margin-bottom: 18px; cursor: pointer; }
.rwp-auth-error {
    background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px;
    padding: 10px 14px; font-size: 14px; color: #B91C1C; margin-top: 12px;
}
.rwp-bonus-notice {
    background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 8px;
    padding: 12px 16px; font-size: 14px; color: #166534; margin-bottom: 20px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.rwp-btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 24px; background: var(--rwp-accent); color: #fff;
    border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: background .18s, box-shadow .18s; font-family: inherit;
}
.rwp-btn-primary:hover { background: var(--rwp-accent-dark); box-shadow: 0 4px 14px rgba(79,110,247,.3); }
.rwp-btn-primary:disabled { background: #A5B0C8; cursor: not-allowed; box-shadow: none; }
.rwp-btn-full { width: 100%; }
.rwp-btn-ghost { background: none; border: none; color: var(--rwp-accent); font-size: 14px; cursor: pointer; font-family: inherit; text-decoration: underline; padding: 0; }

/* ── Balance card ────────────────────────────────────────── */
.rwp-balance-card {
    background: linear-gradient(135deg, #4F6EF7 0%, #7C3AED 100%);
    border-radius: var(--rwp-radius); padding: 28px; margin-bottom: 16px;
    color: #fff; box-shadow: 0 4px 20px rgba(79,110,247,.25);
}
.rwp-balance-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.rwp-balance-label { font-size: 13px; opacity: .8; margin: 0 0 4px; font-weight: 500; }
.rwp-balance-amount { font-size: 36px; font-weight: 800; margin: 0 0 4px; line-height: 1; }
.rwp-balance-sub { font-size: 13px; opacity: .75; margin: 0; }
.rwp-buy-btn { background: #fff; color: var(--rwp-accent); flex-shrink: 0; }
.rwp-buy-btn:hover { background: #f0f4ff; box-shadow: none; }

/* ── Costs / history cards ───────────────────────────────── */
.rwp-costs-card, .rwp-history-card {
    background: var(--rwp-surface); border: 1px solid var(--rwp-border);
    border-radius: var(--rwp-radius); padding: 22px 24px; margin-bottom: 14px;
    box-shadow: var(--rwp-shadow);
}
.rwp-costs-card h3, .rwp-history-card h3 {
    font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--rwp-muted); margin: 0 0 14px;
}
.rwp-cost-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--rwp-border); font-size: 14px; }
.rwp-cost-row:last-of-type { border-bottom: none; }
.rwp-cost-model { display: flex; align-items: center; gap: 8px; }
.rwp-cost-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.rwp-cost-badge--google { background: #E8F5E9; color: #2E7D32; }
.rwp-cost-badge--openai { background: #E3F2FD; color: #1565C0; }
.rwp-cost-credits { font-weight: 700; color: var(--rwp-accent); }
.rwp-costs-note { font-size: 12px; color: var(--rwp-muted); margin-top: 10px; }

.rwp-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rwp-history-table th { text-align: left; padding: 6px 0; font-weight: 600; color: var(--rwp-muted); border-bottom: 1px solid var(--rwp-border); }
.rwp-history-table td { padding: 8px 0; border-bottom: 1px solid var(--rwp-border); color: var(--rwp-text); }
.rwp-history-table tr:last-child td { border-bottom: none; }
.rwp-empty { color: var(--rwp-muted); font-size: 14px; }

/* ── Account footer ──────────────────────────────────────── */
.rwp-account-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 16px; font-size: 13px; color: var(--rwp-muted);
}

/* ── Buy page ────────────────────────────────────────────── */
.rwp-buy-status {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px; border-radius: 10px; margin-bottom: 24px; font-size: 14px;
    font-weight: 500;
}
.rwp-buy-status--success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.rwp-buy-status--cancelled { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; }
.rwp-buy-status-icon { font-size: 22px; flex-shrink: 0; }
.rwp-buy-balance-bar {
    background: var(--rwp-accent-light); border: 1px solid #c7d7fc;
    border-radius: 8px; padding: 12px 18px; font-size: 14px; color: var(--rwp-accent);
    font-weight: 600; margin-bottom: 24px; display: flex; align-items: center; gap: 8px;
}
.rwp-buy-login-notice {
    background: #FFF8E1; border: 1px solid #FDE68A; border-radius: 10px;
    padding: 16px 20px; font-size: 14px; color: #92400E; margin-bottom: 24px;
    line-height: 1.6;
}
.rwp-buy-login-notice a { color: #92400E; font-weight: 700; }
/* Pack grid — always 3 columns on desktop, stacks on mobile */
.rwp-packs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
    align-items: start;
}
.rwp-pack-card {
    background: var(--rwp-surface);
    border: 1.5px solid var(--rwp-border);
    border-radius: var(--rwp-radius);
    padding: 28px 24px 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow .2s, border-color .2s;
}
.rwp-pack-card:hover {
    box-shadow: 0 6px 24px rgba(79,110,247,.14);
    border-color: var(--rwp-accent);
}
.rwp-pack-card--featured {
    border-color: var(--rwp-accent);
    box-shadow: 0 4px 20px rgba(79,110,247,.15);
}
.rwp-pack-badge {
    position: absolute;
    top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--rwp-accent); color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: .04em;
    padding: 4px 14px; border-radius: 99px; white-space: nowrap;
    text-transform: uppercase;
}
.rwp-pack-name { font-size: 16px; font-weight: 700; color: var(--rwp-muted); text-transform: uppercase; letter-spacing: .05em; }
.rwp-pack-price { font-size: 36px; font-weight: 800; color: var(--rwp-accent); line-height: 1; margin: 4px 0; }
.rwp-pack-credits { font-size: 13px; color: var(--rwp-muted); font-weight: 500; }
.rwp-pack-desc { font-size: 13px; color: var(--rwp-muted); line-height: 1.5; margin: 8px 0 4px; }
.rwp-pack-features {
    font-size: 13px; color: var(--rwp-text);
    margin: 4px 0 16px; padding-left: 0;
    list-style: none;
}
.rwp-pack-features li {
    padding: 5px 0;
    border-bottom: 1px solid var(--rwp-border);
    display: flex; align-items: center; gap: 8px;
}
.rwp-pack-features li::before { content: '✓'; color: #059669; font-weight: 700; flex-shrink: 0; }
.rwp-pack-features li:last-child { border-bottom: none; }
/* Push buy button to bottom of card regardless of content height */
.rwp-pack-card .rwp-btn-primary { margin-top: auto; }

/* Stripe trust line */
.rwp-stripe-note {
    display: flex; align-items: center; gap: 8px;
    background: var(--rwp-bg, #fafafa); border: 1px solid var(--rwp-border);
    border-radius: 8px; padding: 12px 16px;
    font-size: 13px; color: var(--rwp-muted);
}
.rwp-stripe-note svg { flex-shrink: 0; color: #059669; }
.rwp-buy-error {
    background: #FEF2F2; border: 1px solid #FECACA;
    border-radius: 8px; padding: 12px 16px;
    font-size: 14px; color: #B91C1C; margin-top: 12px;
}

/* Responsive — stay 3 columns unless very narrow */
@media (max-width: 600px) {
    .rwp-packs-grid { grid-template-columns: 1fr; }
    .rwp-buy-wrap { padding-left: 12px; padding-right: 12px; }
}

/* ── Credit bar in editor ────────────────────────────────── */
#rwp-credit-bar {
    display: none; align-items: center; gap: 12px;
    background: var(--rwp-accent-light); border: 1px solid #c7d7fc;
    border-radius: 8px; padding: 10px 16px; margin-bottom: 14px;
    font-size: 13px; flex-wrap: wrap;
}
.rwp-cb-balance { color: var(--rwp-accent); font-weight: 600; }
.rwp-cb-balance strong { font-size: 16px; }
.rwp-cb-buy { color: var(--rwp-accent); text-decoration: underline; margin-left: auto; }
.rwp-cb-admin { color: #059669; font-weight: 500; font-size: 12px; margin-left: auto; }
.rwp-cb-guest { color: var(--rwp-muted); }
.rwp-cb-guest a { color: var(--rwp-accent); }

/* ── Editor login gate ───────────────────────────────────── */
.rwp-gate-wrap {
    max-width: 480px;
    margin: 32px auto 48px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--rwp-text);
}
.rwp-gate-hero {
    text-align: center;
    margin-bottom: 28px;
}
.rwp-gate-icon {
    font-size: 44px;
    line-height: 1;
    margin-bottom: 12px;
}
.rwp-gate-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 10px;
    color: var(--rwp-text);
}
.rwp-gate-subtitle {
    font-size: 15px;
    color: var(--rwp-muted);
    line-height: 1.6;
    margin: 0;
}
.rwp-gate-card {
    background: var(--rwp-surface);
    border: 1px solid var(--rwp-border);
    border-radius: var(--rwp-radius);
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    overflow: hidden;
}
.rwp-gate-card .rwp-auth-tabs {
    background: #F9FAFB;
    border-bottom: 1px solid var(--rwp-border);
}
.rwp-gate-card .rwp-auth-panel-inner {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 28px;
}
.rwp-gate-footer {
    text-align: center;
    font-size: 13px;
    color: var(--rwp-muted);
    margin-top: 18px;
}

/* ═══════════════════════════════════════════════════════════
   [retouch_pricing] — Homepage pricing table
   ═══════════════════════════════════════════════════════════ */

.rwp-pricing-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 980px;
    margin: 0 auto;
    padding: 8px 0 40px;
    color: var(--rwp-text, #1A1D23);
    box-sizing: border-box;
}
.rwp-pricing-wrap * { box-sizing: border-box; }

.rwp-pricing-intro {
    text-align: center;
    font-size: 15px;
    color: var(--rwp-muted, #6B7280);
    margin: 0 0 32px;
    line-height: 1.6;
}

/* ── Pack grid ──────────────────────────────────────────── */
.rwp-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 36px;
    align-items: stretch;
}
.rwp-pricing-card {
    background: #fff;
    border: 1.5px solid #E2E5ED;
    border-radius: 14px;
    padding: 32px 24px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow .2s, border-color .2s, transform .2s;
}
.rwp-pricing-card:hover {
    box-shadow: 0 8px 28px rgba(79,110,247,.12);
    border-color: #4F6EF7;
    transform: translateY(-2px);
}
.rwp-pricing-card--featured {
    border-color: #4F6EF7;
    box-shadow: 0 6px 24px rgba(79,110,247,.16);
    background: #F7F9FF;
}
.rwp-pricing-badge {
    position: absolute;
    top: -14px; left: 50%; transform: translateX(-50%);
    background: #4F6EF7; color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase;
    padding: 5px 16px; border-radius: 99px;
    white-space: nowrap;
}

/* ── Card header ──────────────────────────────────────── */
.rwp-pricing-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E2E5ED;
}
.rwp-pricing-name {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9CA3AF;
    margin-bottom: 8px;
}
.rwp-pricing-price {
    font-size: 42px;
    font-weight: 800;
    color: #4F6EF7;
    line-height: 1;
    margin-bottom: 6px;
}
.rwp-pricing-credits {
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}

/* ── Feature list ─────────────────────────────────────── */
.rwp-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}
.rwp-pricing-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #F0F1F5;
}
.rwp-pricing-features li:last-child { border-bottom: none; }
.rwp-pricing-features li::before {
    content: '✓';
    color: #059669;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background: #ECFDF5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── CTA button ───────────────────────────────────────── */
.rwp-pricing-btn {
    display: block;
    text-align: center;
    padding: 13px 20px;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s, box-shadow .18s, transform .1s;
    border: 2px solid #4F6EF7;
    color: #4F6EF7;
    background: transparent;
}
.rwp-pricing-btn:hover {
    background: #4F6EF7;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79,110,247,.3);
}
.rwp-pricing-btn--featured {
    background: #4F6EF7;
    color: #fff;
}
.rwp-pricing-btn--featured:hover {
    background: #3a57e0;
    box-shadow: 0 4px 16px rgba(79,110,247,.4);
}

/* ── Per-edit breakdown ───────────────────────────────── */
.rwp-pricing-breakdown {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 24px;
}
.rwp-pricing-breakdown-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9CA3AF;
    margin: 0 0 14px;
}
.rwp-pricing-costs { display: flex; flex-direction: column; gap: 0; }
.rwp-pricing-cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #E5E7EB;
    font-size: 14px;
}
.rwp-pricing-cost-item:last-of-type { border-bottom: none; }
.rwp-pricing-cost-engine { color: #374151; }
.rwp-pricing-cost-credits { font-weight: 700; color: #4F6EF7; }
.rwp-pricing-costs-note {
    font-size: 12px;
    color: #9CA3AF;
    margin: 12px 0 0;
}

/* ── Free signup bar ──────────────────────────────────── */
.rwp-pricing-signup {
    background: linear-gradient(135deg, #4F6EF7 0%, #7C3AED 100%);
    border-radius: 12px;
    padding: 20px 24px;
}
.rwp-pricing-signup-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    color: #fff;
}
.rwp-pricing-signup-icon { font-size: 28px; flex-shrink: 0; }
.rwp-pricing-signup-inner div { flex: 1; font-size: 14px; line-height: 1.5; min-width: 200px; }
.rwp-pricing-signup-inner strong { font-size: 15px; display: block; margin-bottom: 2px; }
.rwp-pricing-signup-btn {
    flex-shrink: 0;
    background: #fff;
    color: #4F6EF7;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s;
    white-space: nowrap;
}
.rwp-pricing-signup-btn:hover { background: #EEF1FE; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 720px) {
    .rwp-pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
    .rwp-pricing-wrap { padding-left: 12px; padding-right: 12px; }
}
@media (min-width: 721px) and (max-width: 900px) {
    .rwp-pricing-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .rwp-pricing-price { font-size: 34px; }
    .rwp-pricing-card { padding: 28px 18px 20px; }
}

/* ═══════════════════════════════════════════════════════════
   [retouch_intro] — Homepage steps + notice
   ═══════════════════════════════════════════════════════════ */

.rwp-intro-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 980px;
    margin: 0 auto 32px;
    box-sizing: border-box;
}
.rwp-intro-wrap * { box-sizing: border-box; }

/* Notice bar */
.rwp-intro-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #EFF6FF;
    border: 1.5px solid #BFDBFE;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.rwp-intro-notice-icon {
    width: 28px; height: 28px;
    background: #3B82F6; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800;
    flex-shrink: 0;
}
.rwp-intro-notice-text {
    flex: 1;
    font-size: 14px;
    color: #1E40AF;
    line-height: 1.5;
    min-width: 220px;
}
.rwp-intro-notice-btn {
    flex-shrink: 0;
    background: #3B82F6; color: #fff;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px; font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s;
}
.rwp-intro-notice-btn:hover { background: #2563EB; }

/* Steps row */
.rwp-intro-steps {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff;
    border: 1px solid #E2E5ED;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.rwp-intro-step {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.rwp-intro-step-num {
    width: 34px; height: 34px;
    background: #4F6EF7; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}
.rwp-intro-step-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rwp-intro-step-body strong {
    font-size: 14px;
    color: #1A1D23;
    line-height: 1.3;
}
.rwp-intro-step-body span {
    font-size: 13px;
    color: #6B7280;
    line-height: 1.5;
}
.rwp-intro-step-arrow {
    color: #D1D5DB;
    font-size: 22px;
    padding-top: 6px;
    flex-shrink: 0;
}

@media (max-width: 680px) {
    .rwp-intro-steps {
        flex-direction: column;
        gap: 18px;
        padding: 20px;
    }
    .rwp-intro-step-arrow { display: none; }
    .rwp-intro-notice { padding: 14px 16px; }
    .rwp-intro-wrap { padding: 0 12px; }
}

/* ── Account page: context banner (shown when ?next=buy-credits) ─── */
.rwp-account-context-banner {
    background: linear-gradient(135deg, #4F6EF7 0%, #7C3AED 100%);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    color: #fff;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.rwp-account-context-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.rwp-account-context-body strong { display: block; font-size: 16px; margin-bottom: 4px; }
.rwp-account-context-body p { font-size: 14px; opacity: .88; margin: 0; line-height: 1.5; }
