/**
 * RevenueOS Content Gate Premium — Frontend Styles
 * Version: 2.0.0
 *
 * Dark glassmorphic single-CTA card design.
 */

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

/* ------------------------------------------------------------------ */
/*  Design tokens                                                      */
/* ------------------------------------------------------------------ */

:root {
    --ros-cgp-primary: #1b4d3e;
    --ros-cgp-accent: #d4a941;
    --ros-cgp-surface: #0f1117;
    --ros-cgp-surface-card: #15171e;
    --ros-cgp-text: #ffffff;
    --ros-cgp-muted: #9ca3af;
    --ros-cgp-border: rgba(255, 255, 255, 0.08);
    --ros-cgp-border-hover: rgba(255, 255, 255, 0.14);
    --ros-cgp-danger: #ef4444;
    --ros-cgp-success: #22c55e;
    --ros-cgp-radius: 16px;
    --ros-cgp-radius-sm: 10px;
    --ros-cgp-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    --ros-cgp-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ------------------------------------------------------------------ */
/*  Shell                                                              */
/* ------------------------------------------------------------------ */

.ros-cgp-shell,
.ros-cgp-shell * {
    box-sizing: border-box;
}

.ros-cgp-shell {
    margin: 40px auto;
    max-width: 560px;
    font-family: var(--ros-cgp-font);
    color: var(--ros-cgp-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------------ */
/*  Teaser                                                             */
/* ------------------------------------------------------------------ */

.ros-cgp-teaser {
    margin-bottom: 20px;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--ros-cgp-border);
    border-radius: var(--ros-cgp-radius);
    background: var(--ros-cgp-surface-card);
    overflow: hidden;
    position: relative;
    color: var(--ros-cgp-muted);
    font-size: 15px;
    line-height: 1.7;
}

.ros-cgp-teaser::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 72px;
    background: linear-gradient(
        180deg,
        rgba(15, 17, 23, 0),
        var(--ros-cgp-surface-card) 90%
    );
    pointer-events: none;
}

/* ------------------------------------------------------------------ */
/*  Card                                                               */
/* ------------------------------------------------------------------ */

.ros-cgp-card {
    padding: clamp(28px, 5vw, 40px);
    border: 1px solid var(--ros-cgp-border);
    border-radius: var(--ros-cgp-radius);
    background: var(--ros-cgp-surface-card);
    box-shadow: var(--ros-cgp-shadow);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.ros-cgp-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(
        circle,
        rgba(27, 77, 62, 0.25) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* ------------------------------------------------------------------ */
/*  Eyebrow                                                            */
/* ------------------------------------------------------------------ */

.ros-cgp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ros-cgp-muted);
}

.ros-cgp-lock-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/*  Title + Subtitle                                                   */
/* ------------------------------------------------------------------ */

.ros-cgp-title {
    margin: 0 0 10px;
    font-family: var(--ros-cgp-font);
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--ros-cgp-text);
}

.ros-cgp-subtitle {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ros-cgp-muted);
    max-width: 38ch;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------------------------------ */
/*  Balance row                                                        */
/* ------------------------------------------------------------------ */

.ros-cgp-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 24px;
    padding: 14px 18px;
    border-top: 1px solid var(--ros-cgp-border);
    border-bottom: 1px solid var(--ros-cgp-border);
}

.ros-cgp-balance__label {
    font-size: 14px;
    color: var(--ros-cgp-muted);
    font-weight: 500;
}

.ros-cgp-balance__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(212, 169, 65, 0.15);
    color: var(--ros-cgp-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    min-width: 72px;
    justify-content: center;
    transition: background-color 200ms ease, color 200ms ease;
}

.ros-cgp-balance--low .ros-cgp-balance__pill {
    background: rgba(239, 68, 68, 0.15);
    color: var(--ros-cgp-danger);
}

.ros-cgp-balance__spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(212, 169, 65, 0.3);
    border-top-color: var(--ros-cgp-accent);
    border-radius: 50%;
    animation: ros-cgp-spin 0.7s linear infinite;
}

/* ------------------------------------------------------------------ */
/*  Actions                                                            */
/* ------------------------------------------------------------------ */

.ros-cgp-actions {
    margin: 0 0 16px;
}

/* ------------------------------------------------------------------ */
/*  Button                                                             */
/* ------------------------------------------------------------------ */

.ros-cgp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 14px 24px;
    border: none;
    border-radius: 999px;
    font-family: var(--ros-cgp-font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 180ms ease,
        opacity 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease;
}

.ros-cgp-button:hover,
.ros-cgp-button:focus-visible {
    transform: translateY(-1px);
}

.ros-cgp-button:active {
    transform: translateY(0);
}

.ros-cgp-button--primary {
    background: linear-gradient(135deg, var(--ros-cgp-primary), #28624f);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(27, 77, 62, 0.35);
}

.ros-cgp-button--primary:hover,
.ros-cgp-button--primary:focus-visible {
    box-shadow: 0 12px 32px rgba(27, 77, 62, 0.5);
}

.ros-cgp-button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ------------------------------------------------------------------ */
/*  Sub-links                                                          */
/* ------------------------------------------------------------------ */

.ros-cgp-sub-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ros-cgp-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--ros-cgp-muted);
    text-decoration: underline;
    text-decoration-color: rgba(156, 163, 175, 0.4);
    text-underline-offset: 3px;
    transition: color 150ms ease, text-decoration-color 150ms ease;
    cursor: pointer;
}

.ros-cgp-link:hover,
.ros-cgp-link:focus-visible {
    color: var(--ros-cgp-text);
    text-decoration-color: rgba(255, 255, 255, 0.5);
}

/* ------------------------------------------------------------------ */
/*  Loading state                                                      */
/* ------------------------------------------------------------------ */

.ros-cgp-shell.is-loading .ros-cgp-button--primary {
    pointer-events: none;
    opacity: 0.75;
}

.ros-cgp-button .ros-cgp-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ros-cgp-spin 0.7s linear infinite;
}

.ros-cgp-shell.is-loading .ros-cgp-btn-spinner {
    display: inline-block;
}

.ros-cgp-shell.is-loading .ros-cgp-btn-label {
    opacity: 0.7;
}

/* ------------------------------------------------------------------ */
/*  Success state                                                      */
/* ------------------------------------------------------------------ */

.ros-cgp-shell.is-success .ros-cgp-card {
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.1);
    animation: ros-cgp-success-pulse 1.2s ease;
}

.ros-cgp-shell.is-success .ros-cgp-button--primary {
    background: var(--ros-cgp-success);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
    pointer-events: none;
}

.ros-cgp-shell.is-success .ros-cgp-sub-links {
    opacity: 0;
    transition: opacity 300ms ease;
}

/* ------------------------------------------------------------------ */
/*  Error state                                                        */
/* ------------------------------------------------------------------ */

.ros-cgp-shell.is-error .ros-cgp-card {
    border-color: rgba(239, 68, 68, 0.2);
}

.ros-cgp-shell.is-error .ros-cgp-subtitle {
    color: var(--ros-cgp-danger);
}

/* ------------------------------------------------------------------ */
/*  Animations                                                         */
/* ------------------------------------------------------------------ */

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

@keyframes ros-cgp-success-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.25); }
    50%  { box-shadow: 0 0 40px 8px rgba(34, 197, 94, 0.12); }
    100% { box-shadow: 0 0 40px rgba(34, 197, 94, 0.1); }
}

/* ------------------------------------------------------------------ */
/*  Reduced motion                                                     */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .ros-cgp-button,
    .ros-cgp-link,
    .ros-cgp-balance__pill,
    .ros-cgp-balance__spinner,
    .ros-cgp-btn-spinner {
        animation: none;
        transition: none;
    }
}
