/* App-level styles shared by the converter pages (account, checkout, toasts, pricing). */

/* ----- Hero headline gradient -----
   The old gradient began and ended on white and was 300% wide, so only the pale
   left third ever showed. Keep every stop saturated enough to read on both themes. */
.hero h1 .gradient-text,
.gradient-text {
    background: linear-gradient(90deg, #c7d2fe 0%, #a78bfa 45%, #e879f9 100%);
    background-size: 100% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.light-theme .hero h1 .gradient-text,
.light-theme .gradient-text {
    background-image: linear-gradient(90deg, #4338ca 0%, #7c3aed 50%, #c026d3 100%);
}

/* ----- Flash toasts ----- */
.flash-stack {
    position: fixed;
    top: 104px;
    right: 20px;
    z-index: 2000;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 40px));
}

.flash-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(129, 140, 248, 0.35);
    background: rgba(17, 17, 27, 0.94);
    color: #e5e7eb;
    font-size: 0.92rem;
    line-height: 1.45;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    animation: toastIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.flash-toast i { margin-top: 2px; color: #a5b4fc; }
.flash-toast span { flex: 1; }
.flash-toast-success { border-color: rgba(16, 185, 129, 0.45); }
.flash-toast-success i { color: #34d399; }
.flash-toast-error,
.flash-toast-danger { border-color: rgba(239, 68, 68, 0.45); }
.flash-toast-error i,
.flash-toast-danger i { color: #f87171; }
.flash-toast-warning { border-color: rgba(245, 158, 11, 0.45); }
.flash-toast-warning i { color: #fbbf24; }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.flash-close:hover { opacity: 1; }

.flash-toast.is-leaving { animation: toastOut 0.35s ease forwards; }

.light-theme .flash-toast {
    background: rgba(255, 255, 255, 0.97);
    color: #1f2937;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(24px); }
}

/* ----- Buttons ----- */
.btn-block { width: 100%; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-danger:hover { background: #ef4444; color: #fff; }
.light-theme .btn-danger { color: #b91c1c; }
.light-theme .btn-danger:hover { color: #fff; }

/* ----- Pricing cards (inner elements were never styled) ----- */
.pricing-tier {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 10px;
}
.light-theme .pricing-tier { color: #4f46e5; }

.pricing-price {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
}
.pricing-price span {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.pricing-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 20px;
}

.pricing-features {
    list-style: none;
    display: grid;
    gap: 10px;
    margin: 0 0 24px;
    padding: 0;
    flex: 1;
}
.pricing-features li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.pricing-features li i { color: #34d399; font-size: 0.8rem; }
.light-theme .pricing-features li i { color: #059669; }

.pricing-card .pricing-cta { width: 100%; }

/* ----- Account ----- */
.account-section { padding-top: 32px; }
.account-container { max-width: 1120px; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb i { font-size: 0.65rem; opacity: 0.6; }

.account-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    animation: fadeUp 0.45s ease both;
}
.account-avatar {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--gradient-main);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(129, 140, 248, 0.35);
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-header-info h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; margin: 0 0 4px; }
.account-email { color: var(--text-secondary); margin: 0 0 10px; }

.account-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.account-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}
.account-badge.is-success { color: #10b981; border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); }
.account-badge.is-warn { color: #f59e0b; border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }

.account-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.account-main { display: grid; gap: 24px; min-width: 0; }

.account-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(16px);
    animation: fadeUp 0.45s ease both;
}
.light-theme .account-card { background: #fff; box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06); }
.account-main .account-card:nth-child(2) { animation-delay: 0.05s; }
.account-main .account-card:nth-child(3) { animation-delay: 0.1s; }
.account-main .account-card:nth-child(4) { animation-delay: 0.15s; }

.account-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    margin: 0 0 18px;
}
.account-card h2 i { color: var(--accent-light); font-size: 0.95rem; }
.light-theme .account-card h2 i { color: #6366f1; }

.account-usage { position: sticky; top: 96px; display: grid; gap: 14px; }
.account-usage h2 { margin-bottom: 0; }
.usage-stat { display: flex; align-items: baseline; gap: 10px; }
.usage-number { font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: 1; }
.usage-label { color: var(--text-secondary); }
.usage-bar { height: 8px; border-radius: 999px; background: var(--border-glass); overflow: hidden; }
.usage-bar-fill { height: 100%; background: var(--gradient-main); border-radius: inherit; transition: width 0.6s ease; }
.usage-remaining, .usage-note { margin: 0; font-size: 0.88rem; color: var(--text-secondary); }
.usage-note { text-align: center; font-size: 0.8rem; }

.pack-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.85rem; }
.pack-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
}

.usage-meta { margin: 0; display: grid; gap: 6px; font-size: 0.82rem; border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.usage-meta div { display: flex; justify-content: space-between; }
.usage-meta dt { color: var(--text-secondary); }
.usage-meta dd { margin: 0; }

.account-details { margin: 0; display: grid; }
.detail-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt { color: var(--text-secondary); font-size: 0.88rem; }
.detail-row dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--border-subtle);
}
.account-card h2 + .setting-row,
.account-card h2 + form > .setting-row:first-of-type,
.pref-form > .setting-row:first-of-type { border-top: none; padding-top: 0; }
.setting-row > form { margin: 0; flex-shrink: 0; }
.setting-row .btn, .setting-row .btn-danger { flex-shrink: 0; }

.setting-info { display: grid; gap: 4px; min-width: 0; }
.setting-info strong { font-size: 0.95rem; }
.setting-info span { color: var(--text-secondary); font-size: 0.86rem; line-height: 1.5; }

.setting-expand { display: block; }
.setting-expand > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    list-style: none;
    cursor: pointer;
}
.setting-expand > summary::-webkit-details-marker { display: none; }
.setting-expand[open] > summary .btn,
.setting-expand[open] > summary .btn-danger { opacity: 0.6; }

.setting-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    animation: fadeUp 0.25s ease both;
}
.setting-form label { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.setting-form input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid var(--border-glass);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
}
.setting-form input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18); }
.setting-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.setting-link { font-size: 0.85rem; color: var(--accent-light); }
.light-theme .setting-link { color: #4f46e5; }
.setting-warning { margin: 0; font-size: 0.86rem; color: #f59e0b; line-height: 1.5; }
.light-theme .setting-warning { color: #b45309; }
.is-danger .setting-form { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.04); }

.pref-form { display: grid; }
.pref-row { cursor: pointer; }
.pref-form .setting-actions { padding-top: 16px; border-top: 1px solid var(--border-subtle); }

.switch { position: relative; flex-shrink: 0; width: 44px; height: 24px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--border-glass);
    border: 1px solid var(--border-glass);
    transition: background 0.2s;
}
.switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.6, 1);
}
.switch input:checked + .switch-track { background: linear-gradient(135deg, #818cf8, #a78bfa); border-color: transparent; }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.35); }
.light-theme .switch-track { background: #e2e8f0; border-color: #cbd5e1; }

@media (max-width: 900px) {
    .account-grid { grid-template-columns: 1fr; }
    .account-usage { position: static; }
}
@media (max-width: 560px) {
    .detail-row { grid-template-columns: 1fr; gap: 2px; }
    .setting-row, .setting-expand > summary { flex-direction: column; align-items: flex-start; }
    .account-header { flex-direction: column; align-items: flex-start; }
}

/* ----- Checkout ----- */
.checkout-hero { padding-top: 4rem; padding-bottom: 1rem; }
.checkout-hero .hero-badge { margin-bottom: 1rem; }
.checkout-hero h1 { animation: fadeUp 0.5s ease both; }
.checkout-hero .hero-sub {
    max-width: 640px;
    margin: 0.75rem auto 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
    animation: fadeUp 0.5s 0.05s ease both;
}

.checkout-steps {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 28px auto 0;
    padding: 0;
    flex-wrap: wrap;
    animation: fadeUp 0.5s 0.1s ease both;
}
.checkout-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
}
.checkout-steps li span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--border-glass);
}
.checkout-steps li.is-current { color: var(--text-primary); border-color: rgba(129, 140, 248, 0.5); }
.checkout-steps li.is-current span { background: var(--gradient-main); color: #fff; animation: stepPulse 2s ease-in-out infinite; }
.checkout-steps li.is-done span { background: #10b981; color: #fff; }
.checkout-steps li.is-done span { font-size: 0; }
.checkout-steps li.is-done span::before { content: '✓'; font-size: 0.8rem; }

.checkout-wrap { max-width: 980px; margin: 0 auto; padding: 32px 20px 80px; }

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
}

.checkout-card {
    position: relative;
    padding: 28px;
    border-radius: 22px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(18px);
    animation: fadeUp 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.checkout-card:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(99, 102, 241, 0.16); }
.checkout-pay { animation-delay: 0.1s; }
.light-theme .checkout-card { background: #fff; box-shadow: 0 10px 34px rgba(15, 23, 42, 0.07); }

.checkout-summary { overflow: hidden; border-color: rgba(129, 140, 248, 0.4); }
.checkout-summary::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(120deg, #818cf8, #c084fc, #e879f9, #818cf8);
    background-size: 300% 300%;
    animation: borderFlow 6s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.checkout-pack { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.checkout-pack-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--gradient-main);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 10px 26px rgba(129, 140, 248, 0.35);
    animation: float 4s ease-in-out infinite;
}
.checkout-pack-name { font-weight: 700; font-size: 1.05rem; }
.checkout-pack-sub { color: var(--text-secondary); font-size: 0.85rem; }
.checkout-pack-price { margin-left: auto; font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; }

.checkout-features { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 12px; }
.checkout-features li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 0.93rem;
    opacity: 0;
    animation: fadeUp 0.4s ease forwards;
}
.checkout-features li:nth-child(1) { animation-delay: 0.15s; }
.checkout-features li:nth-child(2) { animation-delay: 0.22s; }
.checkout-features li:nth-child(3) { animation-delay: 0.29s; }
.checkout-features li:nth-child(4) { animation-delay: 0.36s; }
.checkout-features i { color: #34d399; }
.light-theme .checkout-features i { color: #059669; }

.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 18px;
    border-top: 1px dashed var(--border-glass);
}
.checkout-total span { color: var(--text-secondary); }
.checkout-total strong { font-size: 1.4rem; }
.checkout-total small { font-size: 0.75rem; color: var(--text-secondary); font-weight: 500; }
.checkout-balance { margin: 14px 0 0; font-size: 0.85rem; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; }

.checkout-pay { display: flex; flex-direction: column; gap: 14px; }
.checkout-pay h2 { font-size: 1.15rem; margin: 0; }
.checkout-muted { margin: 0; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.55; }
.checkout-small { font-size: 0.85rem; }
.checkout-muted a, .checkout-support a, .checkout-result a:not(.btn) { color: var(--accent-light); }
.light-theme .checkout-muted a, .light-theme .checkout-support a, .light-theme .checkout-result a:not(.btn) { color: #4f46e5; }
.checkout-trust { margin: auto 0 0; padding-top: 10px; font-size: 0.8rem; color: var(--text-tertiary); display: flex; gap: 8px; align-items: center; }

.paypal-button-wrapper { min-height: 100px; display: grid; gap: 10px; transition: opacity 0.2s; }
.paypal-button-wrapper.is-processing { opacity: 0.5; pointer-events: none; }
.checkout-skeleton {
    height: 45px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--border-subtle) 25%, var(--border-glass) 50%, var(--border-subtle) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}
.checkout-inline-error {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    animation: shake 0.35s ease;
}
.light-theme .checkout-inline-error { color: #991b1b; background: #fef2f2; border-color: #fca5a5; }

.checkout-result {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 22px 24px;
    margin-bottom: 22px;
    border-radius: 18px;
    border: 1px solid;
    animation: popIn 0.45s cubic-bezier(0.3, 1.4, 0.6, 1) both;
}
.checkout-result h2 { margin: 0 0 4px; font-size: 1.15rem; }
.checkout-result p { margin: 0; color: var(--text-secondary); }
.checkout-result.is-success { border-color: rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.08); }
.checkout-result.is-error { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.07); }
.checkout-result-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
}
.is-success .checkout-result-icon { background: #10b981; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.18); }
.is-error .checkout-result-icon { background: #ef4444; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.18); }
.checkout-result-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.checkout-support { text-align: center; margin: 28px 0 0; font-size: 0.88rem; color: var(--text-secondary); }

@media (max-width: 800px) {
    .checkout-grid { grid-template-columns: 1fr; }
}

/* ----- Shared keyframes ----- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: none; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes shimmer {
    to { background-position: -200% 0; }
}
@keyframes borderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}
@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(129, 140, 248, 0); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .checkout-card, .checkout-features li, .checkout-result, .account-card, .account-header,
    .flash-toast, .checkout-pack-icon, .checkout-summary::before, .checkout-steps li span {
        animation: none !important;
        opacity: 1 !important;
    }
}
