:root {
 --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
 --font-display: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
 --bg: #0f0f12;
 --card: #1a1a1f;
 --card-border: #2a2a32;
 --accent: #e85d04;
 --accent-hover: #c94d00;
 --accent-light: #ff9a3c;
 --accent-glow: rgba(232, 93, 4, 0.42);
 --accent-soft: rgba(232, 93, 4, 0.14);
 --text: #ffffff;
 --text-muted: #9ca3af;
 --toggle-bg: #1e1e24;
 --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
 --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
 --dur-fast: 0.22s;
 --dur-med: 0.4s;
 --dur-slow: 0.65s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto; }
 *, *::before, *::after {
 animation-duration: 0.01ms !important;
 animation-iteration-count: 1 !important;
 transition-duration: 0.01ms !important;
 }
}

body.premium-page {
 font-family: var(--font-ui);
 background: var(--bg);
 color: var(--text);
 min-height: 100vh;
 -webkit-font-smoothing: antialiased;
 text-rendering: optimizeLegibility;
 overflow-x: hidden;
}

body.premium-page::before {
 content: "";
 position: fixed;
 inset: 0;
 background:
 radial-gradient(ellipse 80% 50% at 50% -20%, rgba(232, 93, 4, 0.16), transparent 55%),
 radial-gradient(ellipse 40% 30% at 100% 50%, rgba(232, 93, 4, 0.07), transparent 50%);
 pointer-events: none;
 z-index: 0;
 animation: ambient-drift 18s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
 from { opacity: 0.85; transform: scale(1); }
 to { opacity: 1; transform: scale(1.03); }
}

.premium-wrap {
 position: relative;
 z-index: 1;
 width: 100%;
 max-width: 920px;
 margin: 0 auto;
 padding: 32px 20px 64px;
 display: flex;
 flex-direction: column;
 align-items: center;
 animation: page-in var(--dur-slow) var(--ease-out) both;
}

@keyframes page-in {
 from { opacity: 0; transform: translateY(16px); }
 to { opacity: 1; transform: translateY(0); }
}

.premium-topnav {
 display: flex;
 align-items: center;
 justify-content: space-between;
 margin-bottom: 48px;
 flex-wrap: wrap;
 gap: 16px;
 width: 100%;
 align-self: stretch;
}

.premium-logo {
 font-family: var(--font-display);
 font-size: 1.35rem;
 font-weight: 800;
 color: var(--text);
 text-decoration: none;
 letter-spacing: -0.03em;
 transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.premium-logo:hover { opacity: 0.9; transform: translateY(-1px); }
.premium-logo span { color: var(--accent); }

.premium-topnav-links {
 display: flex;
 align-items: center;
 gap: 12px;
 flex-wrap: wrap;
}

.premium-topnav-links a {
 color: var(--text-muted);
 text-decoration: none;
 font-size: 0.9rem;
 font-weight: 600;
 transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.premium-topnav-links a:hover { color: var(--text); transform: translateY(-1px); }
.premium-topnav-links a.active-link { color: var(--accent); }

.btn-discord {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 padding: 10px 18px;
 background: var(--accent);
 color: #fff;
 border-radius: 8px;
 font-weight: 600;
 font-size: 0.9rem;
 text-decoration: none;
 border: none;
 cursor: pointer;
 font-family: inherit;
 transition:
 background var(--dur-fast) var(--ease-out),
 transform var(--dur-fast) var(--ease-spring),
 box-shadow var(--dur-fast) var(--ease-out);
}

.btn-discord:hover {
 background: var(--accent-hover);
 transform: translateY(-2px);
 box-shadow: 0 8px 24px var(--accent-glow);
}

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

.user-chip {
 display: none;
 align-items: center;
 gap: 10px;
 font-size: 0.85rem;
 color: var(--text-muted);
 animation: fade-in var(--dur-med) var(--ease-out) both;
}

.user-chip.visible { display: flex; }
.user-chip img { width: 32px; height: 32px; border-radius: 50%; }

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

.premium-header {
 text-align: center;
 margin-bottom: 40px;
 width: 100%;
 max-width: 640px;
 animation: fade-in var(--dur-slow) var(--ease-out) 0.08s both;
}

.premium-header h1 {
 font-family: var(--font-display);
 font-size: clamp(1.75rem, 4vw, 2.25rem);
 font-weight: 800;
 letter-spacing: -0.04em;
 margin-bottom: 8px;
}

.premium-header p { color: var(--text-muted); font-size: 1rem; }

/* —— Billing toggle s klizećim pillom —— */
.billing-toggle {
 position: relative;
 display: inline-flex;
 justify-content: center;
 align-items: center;
 background: var(--toggle-bg);
 border-radius: 999px;
 padding: 4px;
 margin: 0 auto 48px;
 width: fit-content;
 animation: fade-in var(--dur-slow) var(--ease-out) 0.12s both;
}

.billing-toggle-pill {
 position: absolute;
 top: 4px;
 bottom: 4px;
 left: 4px;
 width: calc(50% - 4px);
 border-radius: 999px;
 background: var(--accent);
 box-shadow: 0 4px 20px var(--accent-glow);
 transition: transform 0.45s var(--ease-spring), width 0.35s var(--ease-out);
 z-index: 0;
 pointer-events: none;
}

.billing-toggle[data-billing="yearly"] .billing-toggle-pill {
 transform: translateX(100%);
}

.billing-toggle button {
 position: relative;
 z-index: 1;
 border: none;
 background: transparent;
 color: var(--text-muted);
 padding: 12px 32px;
 border-radius: 999px;
 font-size: 0.8rem;
 font-weight: 700;
 letter-spacing: 0.06em;
 cursor: pointer;
 font-family: inherit;
 min-width: 120px;
 transition: color 0.35s var(--ease-out);
}

.billing-toggle button.active {
 color: var(--text);
}

.billing-toggle button:not(.active):hover {
 color: rgba(255, 255, 255, 0.75);
}

.pricing-grid {
 display: grid;
 grid-template-columns: repeat(2, minmax(280px, 1fr));
 gap: 24px;
 align-items: stretch;
 width: 100%;
 max-width: 720px;
 margin: 0 auto;
 justify-content: center;
}

@media (max-width: 640px) {
 .pricing-grid {
 grid-template-columns: 1fr;
 max-width: 400px;
 }
}

.pricing-card {
 background: var(--card);
 border: 1px solid var(--card-border);
 border-radius: 16px;
 padding: 32px;
 display: flex;
 flex-direction: column;
 position: relative;
 overflow: hidden;
 transform: translateY(0) scale(1);
 transition:
 transform 0.45s var(--ease-out),
 border-color 0.35s var(--ease-out),
 box-shadow 0.45s var(--ease-out);
 animation: card-in var(--dur-slow) var(--ease-out) both;
 will-change: transform;
 contain: layout style;
}

.pricing-card::before {
 content: "";
 position: absolute;
 inset: 0;
 background: linear-gradient(145deg, rgba(232, 93, 4, 0.1), transparent 55%);
 opacity: 0;
 transition: opacity 0.4s var(--ease-out);
 pointer-events: none;
}

.pricing-card:nth-child(1) { animation-delay: 0.18s; }
.pricing-card:nth-child(2) { animation-delay: 0.28s; }

@keyframes card-in {
 from { opacity: 0; transform: translateY(24px) scale(0.97); }
 to { opacity: 1; transform: translateY(0) scale(1); }
}

.pricing-card:hover {
 transform: translateY(-8px) scale(1.02);
 border-color: rgba(232, 93, 4, 0.4);
 box-shadow:
 0 20px 50px rgba(0, 0, 0, 0.4),
 0 0 0 1px rgba(232, 93, 4, 0.25);
}

.pricing-card:hover::before { opacity: 1; }

.pricing-card.highlight {
 border-color: rgba(232, 93, 4, 0.6);
 box-shadow: 0 0 0 1px rgba(232, 93, 4, 0.4), 0 12px 40px rgba(232, 93, 4, 0.14);
}

.pricing-card.highlight:hover {
 box-shadow:
 0 24px 56px rgba(232, 93, 4, 0.22),
 0 0 0 1px var(--accent);
}

.card-title {
 font-size: 1.2rem;
 font-weight: 700;
 margin-bottom: 16px;
}

.card-price {
 font-size: 2.5rem;
 font-weight: 800;
 line-height: 1.1;
 margin-bottom: 4px;
 display: flex;
 flex-wrap: wrap;
 align-items: baseline;
 gap: 0.35rem 0.5rem;
}

.amount-wrap {
 display: inline-block;
 overflow: hidden;
 min-width: 2.5ch;
}

.card-price .amount {
 display: inline-block;
 transition:
 opacity 0.25s var(--ease-out),
 transform 0.35s var(--ease-spring);
}

.card-price.is-updating .amount {
 opacity: 0;
 transform: translateY(12px) scale(0.92);
}

.card-price .period {
 font-size: 0.95rem;
 font-weight: 400;
 color: var(--text-muted);
 transition: opacity 0.3s var(--ease-out);
}

.card-price.is-updating .period { opacity: 0.5; }

.card-desc {
 color: var(--text-muted);
 font-size: 0.9rem;
 margin: 16px 0 24px;
 line-height: 1.55;
}

.features {
 list-style: none;
 flex: 1;
 margin-bottom: 28px;
}

.features li {
 display: flex;
 align-items: flex-start;
 gap: 10px;
 padding: 8px 0;
 font-size: 0.95rem;
 opacity: 0;
 animation: feature-in 0.5s var(--ease-out) forwards;
}

.pricing-card:nth-child(1) .features li:nth-child(1) { animation-delay: 0.35s; }
.pricing-card:nth-child(1) .features li:nth-child(2) { animation-delay: 0.4s; }
.pricing-card:nth-child(1) .features li:nth-child(3) { animation-delay: 0.45s; }
.pricing-card:nth-child(1) .features li:nth-child(4) { animation-delay: 0.5s; }
.pricing-card:nth-child(1) .features li:nth-child(5) { animation-delay: 0.55s; }
.pricing-card:nth-child(1) .features li:nth-child(6) { animation-delay: 0.6s; }
.pricing-card:nth-child(1) .features li:nth-child(7) { animation-delay: 0.65s; }
.pricing-card:nth-child(2) .features li:nth-child(1) { animation-delay: 0.45s; }
.pricing-card:nth-child(2) .features li:nth-child(2) { animation-delay: 0.5s; }
.pricing-card:nth-child(2) .features li:nth-child(3) { animation-delay: 0.55s; }
.pricing-card:nth-child(2) .features li:nth-child(4) { animation-delay: 0.6s; }
.pricing-card:nth-child(2) .features li:nth-child(5) { animation-delay: 0.65s; }
.pricing-card:nth-child(2) .features li:nth-child(6) { animation-delay: 0.7s; }
.pricing-card:nth-child(2) .features li:nth-child(7) { animation-delay: 0.75s; }

@keyframes feature-in {
 from { opacity: 0; transform: translateX(-8px); }
 to { opacity: 1; transform: translateX(0); }
}

.features li::before {
 content: "✓";
 font-weight: 700;
 flex-shrink: 0;
 color: var(--accent);
}

.btn-subscribe {
 width: 100%;
 padding: 14px 24px;
 border: none;
 border-radius: 8px;
 font-size: 1rem;
 font-weight: 600;
 cursor: pointer;
 font-family: inherit;
 transition:
 background 0.3s var(--ease-out),
 transform 0.25s var(--ease-spring),
 box-shadow 0.3s var(--ease-out);
}

.btn-subscribe:hover {
 transform: translateY(-2px);
 box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.btn-subscribe:active { transform: translateY(0) scale(0.98); }

.btn-subscribe.secondary { background: #2d2d35; color: var(--text); }
.btn-subscribe.secondary:hover { background: #3d3d48; }
.btn-subscribe.primary { background: var(--accent); color: var(--text); }
.btn-subscribe.primary:hover {
 background: var(--accent-hover);
 box-shadow: 0 10px 32px var(--accent-glow);
}

.demo-banner {
 text-align: center;
 margin-top: 32px;
 padding: 14px 18px;
 background: var(--accent-soft);
 border: 1px solid rgba(232, 93, 4, 0.28);
 border-radius: 10px;
 color: var(--text-muted);
 font-size: 0.85rem;
 max-width: 640px;
 margin-left: auto;
 margin-right: auto;
 animation: fade-in var(--dur-med) var(--ease-out) 0.5s both;
}

/* —— Modal —— */
.modal-overlay {
 display: flex;
 position: fixed;
 inset: 0;
 background: rgba(0, 0, 0, 0);
 align-items: center;
 justify-content: center;
 z-index: 200;
 padding: 20px;
 backdrop-filter: blur(0);
 pointer-events: none;
 opacity: 0;
 visibility: hidden;
 transition:
 opacity 0.35s var(--ease-out),
 visibility 0.35s,
 backdrop-filter 0.35s var(--ease-out),
 background 0.35s var(--ease-out);
}

.modal-overlay.open {
 opacity: 1;
 visibility: visible;
 pointer-events: auto;
 background: rgba(0, 0, 0, 0.78);
 backdrop-filter: blur(10px);
}

.modal {
 background: var(--card);
 border: 1px solid var(--card-border);
 border-radius: 16px;
 padding: 28px;
 max-width: 440px;
 width: 100%;
 box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
 transform: scale(0.92) translateY(20px);
 opacity: 0;
 transition:
 transform 0.4s var(--ease-spring),
 opacity 0.3s var(--ease-out);
}

.modal-overlay.open .modal {
 transform: scale(1) translateY(0);
 opacity: 1;
}

.modal h3 { margin-bottom: 8px; font-size: 1.15rem; }

.modal .hint {
 color: var(--text-muted);
 font-size: 0.85rem;
 margin-bottom: 20px;
 line-height: 1.5;
}

.modal label {
 display: block;
 font-size: 0.8rem;
 font-weight: 600;
 margin-bottom: 6px;
 color: var(--text-muted);
}

.modal select,
.modal input {
 width: 100%;
 padding: 12px;
 border: 1px solid var(--card-border);
 border-radius: 8px;
 background: var(--bg);
 color: var(--text);
 margin-bottom: 16px;
 font-size: 1rem;
 font-family: inherit;
 transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.modal select:focus,
.modal input:focus {
 outline: none;
 border-color: var(--accent);
 box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.28);
}

.modal-actions { display: flex; gap: 12px; margin-top: 8px; }

.modal-actions button {
 flex: 1;
 padding: 12px;
 border-radius: 8px;
 border: none;
 font-weight: 600;
 cursor: pointer;
 font-family: inherit;
 transition: transform 0.2s var(--ease-spring), background 0.2s var(--ease-out);
}

.modal-actions button:hover { transform: translateY(-1px); }
.modal-actions button:active { transform: scale(0.98); }
.modal-actions .cancel { background: #2d2d35; color: var(--text); }
.modal-actions .confirm { background: var(--accent); color: var(--text); }

.error-msg {
 color: #f87171;
 font-size: 0.85rem;
 margin-bottom: 12px;
 max-height: 0;
 opacity: 0;
 overflow: hidden;
 transition: max-height 0.35s var(--ease-out), opacity 0.25s, margin 0.25s;
}

.error-msg.show {
 display: block;
 max-height: 120px;
 opacity: 1;
 margin-bottom: 12px;
}

.result-page {
 min-height: 100vh;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 text-align: center;
 padding: 40px 20px;
 position: relative;
 z-index: 1;
 animation: page-in var(--dur-slow) var(--ease-out) both;
}

.result-page h1 { font-size: 2rem; margin-bottom: 16px; }
.result-page h1.ok { color: #22c55e; }
.result-page p { color: var(--text-muted); margin-bottom: 8px; max-width: 420px; }
.result-page a {
 color: var(--accent);
 font-weight: 600;
 margin-top: 24px;
 transition: opacity 0.2s;
}
.result-page a:hover { opacity: 0.85; }
