/*
|--------------------------------------------------------------------------
| new-web design tokens
|--------------------------------------------------------------------------
| Plain CSS, no build step — copied straight to assets/new-web/css/tokens.css
| and loaded first by every layout, so both stylesheets below resolve the same
| colours.
|
| Light is the default skin (auth, policy, contact, dashboard). The marketing
| pages opt into the dark glassmorphism skin with class="dark" on <html>.
*/

:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 217 91% 60%;
    --primary-foreground: 0 0% 100%;
    --primary-light: 217 91% 70%;
    --primary-dark: 217 91% 50%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 217 91% 95%;
    --accent-foreground: 217 91% 20%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --success: 142 71% 45%;
    --warning: 38 92% 50%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 217 91% 60%;
    --radius: 0.5rem;

    --gradient-primary: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-light)));
    --gradient-hero: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary-dark)) 100%);
    --gradient-button: linear-gradient(135deg, hsl(217 91% 60%), hsl(217 91% 70%));

    --glass-bg: 222 47% 11% / 0.04;
    --glass-border: 222 47% 11% / 0.08;
    --glass-hover: 222 47% 11% / 0.06;
    --glass-glow: 217 91% 60% / 0.18;

    --shadow-soft: 0 4px 12px hsl(220 15% 15% / 0.1);
    --shadow-medium: 0 8px 25px hsl(220 15% 15% / 0.15);
    --shadow-large: 0 15px 35px hsl(220 15% 15% / 0.2);
    --shadow-brand: 0 8px 25px hsl(var(--primary) / 0.25);
}

.dark {
    --background: 222 47% 11%;
    --foreground: 210 40% 98%;
    --card: 222 44% 14%;
    --card-foreground: 210 40% 98%;
    --popover: 222 44% 14%;
    --popover-foreground: 210 40% 98%;
    --primary: 217 91% 53%;
    --primary-foreground: 0 0% 100%;
    --primary-light: 213 94% 68%;
    --primary-dark: 217 91% 45%;
    --secondary: 222 30% 18%;
    --secondary-foreground: 210 40% 98%;
    --muted: 222 30% 18%;
    --muted-foreground: 215 20% 65%;
    --accent: 213 94% 68%;
    --accent-foreground: 222 47% 11%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 210 40% 98%;
    --success: 142 69% 58%;
    --warning: 38 92% 60%;
    --border: 217 30% 22%;
    --input: 217 30% 22%;
    --ring: 217 91% 53%;

    --glass-bg: 0 0% 100% / 0.08;
    --glass-border: 0 0% 100% / 0.15;
    --glass-hover: 0 0% 100% / 0.12;
    --glass-glow: 217 91% 53% / 0.3;
    --gradient-button: linear-gradient(135deg, hsl(217 91% 53%), hsl(213 94% 68%));
    --gradient-hero: linear-gradient(160deg, hsl(222 47% 11%), hsl(224 71% 25%), hsl(222 60% 8%));
}

/* Alpine hides these until it boots; without it the markup flashes on load. */
[x-cloak] {
    display: none !important;
}

/*
|--------------------------------------------------------------------------
| Components
|--------------------------------------------------------------------------
| Written as plain CSS rather than Tailwind @apply so that both stylesheets —
| the preflighted app.css and the preflight-free bridge.css — can rely on them
| from a single definition.
*/

/* The dashboard's welcome/balance surface. Named to match new-web/dashboard.html,
   which the dashboard markup is a port of. */
.bg-gradient-primary {
    background-image: var(--gradient-primary);
}

/* Glassmorphism — marketing skin */

.glass-card,
.glass-card-hover,
.glass-button-outline {
    background: hsl(var(--glass-bg));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid hsl(var(--glass-border));
    box-shadow: 0 8px 32px rgb(0 0 0 / 0.2);
}

.glass-card-hover,
.glass-button-outline {
    transition: all 0.3s ease;
}

.glass-card-hover:hover {
    background: hsl(var(--glass-hover));
    box-shadow: 0 8px 32px rgb(0 0 0 / 0.3), 0 0 20px hsl(var(--glass-glow));
    transform: translateY(-4px);
}

.glass-button-outline {
    font-weight: 600;
}

.glass-button-outline:hover {
    background: hsl(var(--glass-hover));
    transform: translateY(-2px);
}

.glass-button-primary {
    background: var(--gradient-button);
    box-shadow: 0 4px 15px hsl(var(--glass-glow));
    color: hsl(0 0% 100%);
    font-weight: 600;
    transition: all 0.3s ease;
}

.glass-button-primary:hover {
    box-shadow: 0 6px 25px hsl(var(--primary) / 0.5);
    transform: translateY(-2px);
    color: hsl(0 0% 100%);
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}

.glow-text {
    background: var(--gradient-button);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pill-badge {
    background: hsl(var(--glass-bg));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid hsl(var(--glass-border));
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form primitives — light skin */

.nw-label {
    display: block;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.nw-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    color: #111827;
    background-color: #fff;
    font-size: 1rem;
    line-height: 1.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nw-input::placeholder {
    color: #9ca3af;
}

.nw-input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.4);
}

.nw-input-error {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: hsl(var(--destructive));
}

.nw-btn,
.nw-btn-primary,
.nw-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nw-btn:focus,
.nw-btn-primary:focus,
.nw-btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 4px hsl(var(--primary) / 0.3);
}

.nw-btn:disabled,
.nw-btn-primary:disabled,
.nw-btn-outline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nw-btn-primary {
    color: #fff;
    border: 1px solid transparent;
    background-image: linear-gradient(to right, hsl(var(--primary)), hsl(var(--primary-dark)));
}

.nw-btn-primary:hover {
    color: #fff;
    background-image: linear-gradient(to right, hsl(var(--primary-dark)), hsl(var(--primary)));
    transform: scale(1.01);
}

.nw-btn-primary:active {
    transform: scale(0.99);
}

.nw-btn-outline {
    border: 1px solid #d1d5db;
    color: #374151;
    background-color: #fff;
}

.nw-btn-outline:hover {
    background-color: #f9fafb;
}

.nw-card {
    background-color: #fff;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-soft);
}

/*
 * The shared captcha partial emits Bootstrap form markup, and it renders on the
 * auth screens where Bootstrap is not loaded. Give those classes the same look
 * as .nw-input so the captcha field matches the rest of the form. On legacy
 * pages bridge.css restates these and wins on load order.
 */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    color: #111827;
    background-color: #fff;
    font-size: 1rem;
    line-height: 1.5rem;
}

.form-control:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.4);
}

/*
 * Container for admin-authored HTML (policy pages, cookie policy, blog bodies,
 * ticket messages). That copy was written for the old dark template — which
 * coloured headings white — so restate typography here rather than trust it.
 */

.nw-prose {
    color: #374151;
    line-height: 1.75;
}

.nw-prose h1,
.nw-prose h2,
.nw-prose h3,
.nw-prose h4,
.nw-prose h5,
.nw-prose h6 {
    color: #111827;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.nw-prose h1 { font-size: 1.875rem; }
.nw-prose h2 { font-size: 1.5rem; }
.nw-prose h3 { font-size: 1.25rem; }
.nw-prose h4 { font-size: 1.125rem; }

.nw-prose > *:first-child {
    margin-top: 0;
}

.nw-prose p {
    margin-bottom: 1rem;
}

.nw-prose font,
.nw-prose span {
    color: inherit !important;
}

.nw-prose a {
    color: hsl(var(--primary));
    text-decoration: underline;
}

.nw-prose ul,
.nw-prose ol {
    margin: 0 0 1rem 1.5rem;
    padding-left: 0.5rem;
}

.nw-prose ul { list-style: disc; }
.nw-prose ol { list-style: decimal; }

.nw-prose li {
    margin-bottom: 0.375rem;
}

.nw-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

.nw-prose table {
    width: 100%;
    margin-bottom: 1rem;
}

.nw-prose blockquote {
    border-left: 3px solid hsl(var(--primary));
    padding-left: 1rem;
    color: #4b5563;
    font-style: italic;
}
