/* Manody stylesheet, part 04 — Plans and subscriptions (SaaS): dynamic themes, advanced link styles, Appearance screen and plan badges.
   Loaded in order by core/templates/core/includes/stylesheets.html. */

/* ==========================================================================
   Plans and subscriptions (SaaS)
   ========================================================================== */

/* ---------- Dynamic themes (advanced designs, Pro plan) ----------
   Each theme sets its colors and a gradient background (--theme-bg) that
   slowly waves. The animation stops if the visitor reduces motion. */
.page-theme-midnight {
    --bg: #0f172a; --bg-soft: #1e1b4b; --surface: #1e293b; --border: #334155;
    --text: #f1f5f9; --text-muted: #a5b4cf; --accent: #a5b4fc; --accent-contrast: #0f172a;
    --theme-bg:
        radial-gradient(60% 50% at 20% 20%, rgba(99, 102, 241, 0.45), transparent 70%),
        radial-gradient(50% 50% at 80% 70%, rgba(236, 72, 153, 0.25), transparent 70%),
        linear-gradient(160deg, #0f172a, #1e1b4b 55%, #0f172a);
}

.page-theme-ocean {
    --bg: #ecfeff; --bg-soft: #cffafe; --surface: #ffffff; --border: #a5f3fc;
    --text: #083344; --text-muted: #0e7490; --accent: #0e7490; --accent-contrast: #ffffff;
    --theme-bg:
        radial-gradient(55% 45% at 15% 25%, rgba(34, 211, 238, 0.45), transparent 70%),
        radial-gradient(50% 50% at 85% 75%, rgba(59, 130, 246, 0.30), transparent 70%),
        linear-gradient(160deg, #ecfeff, #a5f3fc 60%, #e0f2fe);
}

.page-theme-sunset {
    --bg: #fff7ed; --bg-soft: #ffedd5; --surface: #fffbf5; --border: #fed7aa;
    --text: #431407; --text-muted: #9a3412; --accent: #e11d48; --accent-contrast: #ffffff;
    --theme-bg:
        radial-gradient(55% 45% at 20% 15%, rgba(251, 191, 36, 0.55), transparent 70%),
        radial-gradient(55% 50% at 85% 80%, rgba(244, 63, 94, 0.40), transparent 70%),
        linear-gradient(160deg, #fef3c7, #fecdd3 60%, #fed7aa);
}

.page-theme-lavender {
    --bg: #f5f3ff; --bg-soft: #ede9fe; --surface: #ffffff; --border: #ddd6fe;
    --text: #2e1065; --text-muted: #6d28d9; --accent: #6d28d9; --accent-contrast: #ffffff;
    --theme-bg:
        radial-gradient(55% 45% at 80% 20%, rgba(196, 181, 253, 0.70), transparent 70%),
        radial-gradient(50% 50% at 15% 80%, rgba(244, 114, 182, 0.30), transparent 70%),
        linear-gradient(160deg, #f5f3ff, #ddd6fe 60%, #fae8ff);
}

.page-theme-aurora {
    --bg: #04111d; --bg-soft: #0b1f2e; --surface: #0f2a3a; --border: #1d4256;
    --text: #e6fffa; --text-muted: #8fd3c7; --accent: #5eead4; --accent-contrast: #04111d;
    --theme-bg:
        radial-gradient(60% 40% at 20% 10%, rgba(45, 212, 191, 0.55), transparent 70%),
        radial-gradient(50% 45% at 80% 30%, rgba(168, 85, 247, 0.45), transparent 70%),
        radial-gradient(60% 40% at 50% 95%, rgba(34, 197, 94, 0.35), transparent 70%),
        linear-gradient(180deg, #04111d, #071a2b);
}

.page-theme-neon {
    --bg: #09090b; --bg-soft: #18181b; --surface: #141418; --border: #3f1d4b;
    --text: #fdf4ff; --text-muted: #d8b4fe; --accent: #f0abfc; --accent-contrast: #09090b;
    --theme-bg:
        radial-gradient(45% 40% at 15% 20%, rgba(236, 72, 153, 0.55), transparent 70%),
        radial-gradient(45% 40% at 85% 80%, rgba(6, 182, 212, 0.50), transparent 70%),
        linear-gradient(160deg, #09090b, #130a1f 60%, #09090b);
}

.page-theme-prism {
    --bg: #fdf4ff; --bg-soft: #fae8ff; --surface: #ffffff; --border: #e9d5ff;
    --text: #1e1b4b; --text-muted: #6b5fa5; --accent: #7c3aed; --accent-contrast: #ffffff;
    --theme-bg:
        radial-gradient(45% 40% at 10% 15%, rgba(251, 146, 60, 0.45), transparent 70%),
        radial-gradient(45% 40% at 90% 20%, rgba(236, 72, 153, 0.40), transparent 70%),
        radial-gradient(50% 45% at 30% 90%, rgba(56, 189, 248, 0.45), transparent 70%),
        radial-gradient(45% 40% at 85% 85%, rgba(163, 230, 53, 0.35), transparent 70%),
        linear-gradient(160deg, #fdf4ff, #f0f9ff);
}

.page-theme-ember {
    --bg: #1c0a05; --bg-soft: #2a120a; --surface: #2d150c; --border: #5a2a14;
    --text: #fff7ed; --text-muted: #fdba74; --accent: #fb923c; --accent-contrast: #1c0a05;
    --theme-bg:
        radial-gradient(55% 45% at 50% 100%, rgba(249, 115, 22, 0.55), transparent 70%),
        radial-gradient(45% 40% at 15% 30%, rgba(220, 38, 38, 0.40), transparent 70%),
        radial-gradient(40% 35% at 85% 25%, rgba(251, 191, 36, 0.30), transparent 70%),
        linear-gradient(180deg, #1c0a05, #2a0f06);
}

:is(.page-theme-midnight, .page-theme-ocean, .page-theme-sunset, .page-theme-lavender,
    .page-theme-aurora, .page-theme-neon, .page-theme-prism, .page-theme-ember) {
    background-color: var(--bg);
    background-image: var(--theme-bg);
    background-size: 220% 220%;
    animation: theme-drift 16s ease-in-out infinite alternate;
}

body.public-page:is(.page-theme-midnight, .page-theme-ocean, .page-theme-sunset, .page-theme-lavender,
    .page-theme-aurora, .page-theme-neon, .page-theme-prism, .page-theme-ember) {
    background-attachment: fixed;
}

@keyframes theme-drift {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 100% 40%; }
    100% { background-position: 40% 100%; }
}

/* Theme thumbnails: a small phone (avatar and two links). */
.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14%;
    overflow: hidden;
}

.theme-swatch[class*="page-theme-"] { background-color: var(--bg); }

.theme-swatch b {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
}

.theme-swatch .demo-link {
    display: block;
    width: 100%;
    height: 10px;
    min-height: 0;
    padding: 0;
    font-size: 0;
}

.theme-swatch.buttons-shadow .demo-link { box-shadow: 2px 2px 0 var(--text); }

/* Link style thumbnails, on the chosen theme. */
.button-demo {
    display: grid;
    gap: 6px;
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    background-color: var(--bg);
}

.button-demo .demo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 8px;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 500;
}

/* Base shape shared by links (public page, previews, thumbnails). */
.demo-link {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
}

.demo-link.is-featured {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}

.buttons-pill .demo-link   { border-radius: 999px; }
.buttons-square .demo-link { border-radius: 3px; }

/* ---------- Advanced link styles (Pro plan) ---------- */

/* Outline: transparent background, thick stroke. */
.buttons-outline :is(.public-link, .profile-links li, .demo-link) {
    background: transparent;
    border: 2px solid var(--text);
    border-radius: 12px;
    color: var(--text);
}

.buttons-outline :is(.public-link.is-affiliate, .profile-links li.is-featured, .demo-link.is-featured) {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}

.buttons-outline .public-link:hover {
    background: color-mix(in srgb, var(--text) 8%, transparent);
    border-color: var(--text);
    box-shadow: none;
}

/* Drop shadow: graphic style, sharp offset shadow. */
.buttons-shadow :is(.public-link, .profile-links li, .demo-link) {
    background: var(--surface);
    border: 2px solid var(--text);
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--text);
    color: var(--text);
}

.buttons-shadow :is(.public-link.is-affiliate, .profile-links li.is-featured, .demo-link.is-featured) {
    background: var(--accent);
    color: var(--accent-contrast);
}

.buttons-shadow .public-link:hover {
    transform: translate(-2px, -2px);
    border-color: var(--text);
    box-shadow: 6px 6px 0 var(--text);
}

.buttons-shadow .public-link:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--text);
}

/* Frosted glass: translucent, blurred surface, gorgeous on dynamic themes. */
.buttons-glass :is(.public-link, .profile-links li, .demo-link) {
    background: color-mix(in srgb, var(--surface) 42%, transparent);
    border: 1px solid color-mix(in srgb, #ffffff 40%, transparent);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.30);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    color: var(--text);
}

.buttons-glass :is(.public-link.is-affiliate, .profile-links li.is-featured, .demo-link.is-featured) {
    background: color-mix(in srgb, var(--accent) 72%, transparent);
    color: var(--accent-contrast);
}

.buttons-glass .public-link:hover {
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    border-color: color-mix(in srgb, #ffffff 60%, transparent);
}

/* Animated gradient: accent color flowing through the link. */
.buttons-gradient :is(.public-link, .profile-links li, .demo-link) {
    background: linear-gradient(110deg,
        var(--accent),
        color-mix(in srgb, var(--accent) 45%, #ec4899),
        color-mix(in srgb, var(--accent) 45%, #06b6d4),
        var(--accent));
    background-size: 300% 100%;
    border: 0;
    border-radius: 999px;
    color: var(--accent-contrast);
    animation: link-gradient 7s linear infinite;
}

.buttons-gradient :is(.public-link.is-affiliate, .profile-links li.is-featured, .demo-link.is-featured) {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.buttons-gradient .public-link:hover { box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent); }

@keyframes link-gradient {
    to { background-position: 300% 0; }
}

/* Relief: soft 3D effect, pressed on hover. */
.buttons-soft :is(.public-link, .profile-links li, .demo-link) {
    background: var(--bg-soft);
    border: 0;
    border-radius: 18px;
    box-shadow:
        6px 6px 14px rgba(0, 0, 0, 0.16),
        -5px -5px 12px color-mix(in srgb, var(--surface) 55%, #ffffff);
    color: var(--text);
}

.buttons-soft :is(.public-link.is-affiliate, .profile-links li.is-featured, .demo-link.is-featured) {
    background: var(--accent);
    color: var(--accent-contrast);
}

.buttons-soft .public-link:hover {
    transform: none;
    box-shadow:
        inset 4px 4px 10px rgba(0, 0, 0, 0.16),
        inset -4px -4px 10px color-mix(in srgb, var(--surface) 55%, #ffffff);
}

/* Glow: halo in the accent color. */
.buttons-glow :is(.public-link, .profile-links li, .demo-link) {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
    border-radius: 14px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
    color: var(--text);
}

.buttons-glow :is(.public-link.is-affiliate, .profile-links li.is-featured, .demo-link.is-featured) {
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 60%, transparent);
}

.buttons-glow .public-link:hover {
    border-color: var(--accent);
    box-shadow: 0 0 32px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* The public form button follows the chosen shape. */
.buttons-outline .public-submit,
.buttons-shadow .public-submit { border: 2px solid var(--text); }
.buttons-shadow .public-submit { box-shadow: 4px 4px 0 var(--text); }
.buttons-gradient .public-submit,
.buttons-glass .public-submit  { border-radius: 999px; }
.buttons-glow .public-submit   { box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Appearance screen: groups, Pro options to try ---------- */
.choice-group-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 18px 0 10px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.choice-group-title:first-child { margin-top: 0; }
.choice-group-title .muted { flex-basis: 100%; font-weight: 400; }

button.choice {
    background: transparent;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
}

.choice.is-locked { opacity: 1; cursor: pointer; }
.choice.is-locked > span:last-child { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.choice.is-locked:hover { border-color: var(--border-strong); color: var(--text); }
.choice.is-trying { border-color: #6366f1; box-shadow: 0 0 0 1px #6366f1; color: var(--text); }

.try-hint { margin-top: 10px; }

.try-banner {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    background: #eef2ff;
    color: #312e81;
    font-size: 0.88rem;
}

html[data-theme="dark"] .try-banner { background: rgba(99, 102, 241, 0.14); border-color: rgba(129, 140, 248, 0.35); color: #c7d2fe; }

@media (prefers-reduced-motion: reduce) {
    [class*="page-theme-"],
    .buttons-gradient :is(.public-link, .profile-links li, .demo-link) {
        animation: none !important;
    }
}


/* ---------- Plan badges ---------- */
.plan-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    vertical-align: 1px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.plan-badge-pro      { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.plan-badge-business { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.plan-badge-agency   { background: #fdf4ff; border-color: #f5d0fe; color: #a21caf; }

html[data-theme="dark"] .plan-badge-pro      { background: rgba(99, 102, 241, 0.15); border-color: rgba(129, 140, 248, 0.35); color: #a5b4fc; }
html[data-theme="dark"] .plan-badge-business { background: rgba(16, 185, 129, 0.12); border-color: rgba(52, 211, 153, 0.35); color: #6ee7b7; }
html[data-theme="dark"] .plan-badge-agency   { background: rgba(217, 70, 239, 0.12); border-color: rgba(232, 121, 249, 0.35); color: #f0abfc; }

.badge-danger  { background: var(--danger-soft); color: var(--danger); border: 1px solid currentColor; }
.badge-success { background: #ecfdf5; color: #047857; }
