/* =========================================================
   V4 ALFRADIQUE — "Luxury Signal" Design System
   ========================================================= */

:root {
    --bg: #080A0F;
    --surface: rgba(18, 22, 30, 0.7);
    --surface-hover: rgba(25, 30, 42, 0.85);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(220, 38, 38, 0.4);
    --red: #C41E1E;
    --red-bright: #EF4444;
    --red-muted: rgba(196, 30, 30, 0.12);
    --red-glow: rgba(196, 30, 30, 0.25);
    --text-primary: #F1F5F9;
    --text-secondary: #64748B;
    --text-muted: #334155;
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 80px;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --navbar-h: 64px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* ── Background ── */
.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-noise {
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.6;
}
.bg-diagonal {
    position: absolute; top: -60%; right: -10%; width: 1px; height: 180%;
    background: linear-gradient(to bottom, transparent, var(--red) 40%, var(--red) 60%, transparent);
    opacity: 0.2; transform: rotate(-15deg);
}
.bg-glow-red {
    position: absolute; top: -20%; left: -15%; width: 60vw; height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
    filter: blur(60px);
    animation: breathe 8s ease-in-out infinite alternate;
}
@keyframes breathe {
    from { opacity: 0.5; transform: scale(1); }
    to   { opacity: 0.9; transform: scale(1.08); }
}

/* ══════════════════════════════════════
   NAVBAR
══════════════════════════════════════ */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(8, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.navbar__inner {
    max-width: 1100px; margin: 0 auto;
    padding: 0 var(--space-md);
    height: var(--navbar-h);
    display: flex; align-items: center; gap: var(--space-md);
}
.navbar__logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text-primary);
    flex-shrink: 0;
}
.logo__mark {
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--red-bright); background: var(--red-muted);
}
.logo__mark.small { width: 22px; height: 22px; border-radius: 6px; }
.logo__name {
    font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
    color: var(--text-primary);
}
.navbar__links {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto;
}
.nav-link {
    padding: 7px 14px; border-radius: 8px;
    font-size: 0.875rem; font-weight: 400;
    color: var(--text-secondary); text-decoration: none;
    transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}
.nav-link.active { color: var(--red-bright); }

.navbar__cta {
    padding: 8px 20px; border-radius: 10px;
    background: var(--red); color: #fff;
    font-size: 0.875rem; font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--red-bright);
    transition: background 0.2s, transform 0.15s var(--ease-spring);
    white-space: nowrap; flex-shrink: 0;
}
.navbar__cta:hover { background: var(--red-bright); transform: translateY(-1px); }

/* Mobile toggle */
.navbar__toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
    margin-left: auto;
}
.navbar__toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text-secondary); border-radius: 2px;
    transition: 0.3s;
}
.navbar__mobile {
    display: none; flex-direction: column; gap: 4px;
    padding: var(--space-sm) var(--space-md) var(--space-md);
    border-top: 1px solid var(--border);
}
.navbar__mobile.open { display: flex; }

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
    min-height: 100dvh;
    padding-top: calc(var(--navbar-h) + var(--space-lg));
    padding-bottom: var(--space-xl);
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; gap: var(--space-xl);
    position: relative; z-index: 1;
    animation: enter 0.8s var(--ease-out) both;
}
@keyframes enter {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero__inner { flex: 1; max-width: 560px; }

.hero__badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 100px;
    background: var(--red-muted); border: 1px solid rgba(239,68,68,0.25);
    font-size: 0.75rem; font-weight: 500; color: var(--red-bright);
    letter-spacing: 0.03em; margin-bottom: var(--space-md);
}
.badge__dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--red-bright);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    font-weight: 700; line-height: 1.1;
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}
.hero__title em { font-style: italic; color: var(--red-bright); }

.hero__description {
    font-size: 1rem; font-weight: 300; line-height: 1.75;
    color: var(--text-secondary); max-width: 44ch;
    margin-bottom: var(--space-lg);
}

.hero__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-lg); }

.btn {
    padding: 12px 28px; border-radius: 12px;
    font-size: 0.9rem; font-weight: 500;
    text-decoration: none; display: inline-block;
    transition: transform 0.2s var(--ease-spring), background 0.2s, opacity 0.2s;
}
.btn--primary {
    background: var(--red); color: #fff;
    border: 1px solid var(--red-bright);
}
.btn--primary:hover { background: var(--red-bright); transform: translateY(-2px); }
.btn--ghost {
    background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn--ghost:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }

.hero__platforms { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.platforms__label { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.05em; }
.platforms__logos { display: flex; gap: 8px; }
.platform-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 100px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    font-size: 0.78rem; color: var(--text-secondary);
}

/* Hero preview card */
.hero__preview {
    flex-shrink: 0;
    animation: enter 0.8s var(--ease-out) 0.2s both;
}
.preview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    backdrop-filter: blur(24px);
    width: 280px; overflow: hidden;
    box-shadow: 0 32px 64px -16px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.03) inset;
}
.preview-card__line { height: 3px; background: linear-gradient(90deg, var(--red), var(--red-bright) 60%, transparent); }
.preview-card__row {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem; color: var(--text-secondary);
}
.preview-card__row.muted { opacity: 0.5; border-bottom: none; }
.preview-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-muted); flex-shrink: 0;
}
.preview-dot.google { background: #4285F4; }
.preview-dot.meta { background: #4267B2; }
.preview-status { margin-left: auto; font-size: 0.75rem; }
.preview-status.connected { color: #22C55E; }

/* ══════════════════════════════════════
   SECTIONS
══════════════════════════════════════ */
.section {
    position: relative; z-index: 1;
    padding: var(--space-xl) var(--space-md);
    border-top: 1px solid var(--border);
}
.section__inner { max-width: 1100px; margin: 0 auto; }
.section__overline {
    font-size: 0.7rem; font-weight: 500; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--red-bright); margin-bottom: 12px;
}
.section__title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700; line-height: 1.15;
    margin-bottom: var(--space-sm);
}
.section__title em { font-style: italic; color: var(--red-bright); }
.section__desc {
    font-size: 0.95rem; font-weight: 300; line-height: 1.7;
    color: var(--text-secondary); max-width: 50ch;
    margin-bottom: var(--space-lg);
}

/* ── Steps ── */
.steps {
    display: flex; align-items: flex-start; gap: var(--space-md);
    margin-top: var(--space-lg); flex-wrap: wrap;
}
.step {
    flex: 1; min-width: 200px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: var(--space-md);
}
.step__number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--red-muted); border: 1px solid rgba(239,68,68,0.3);
    color: var(--red-bright); font-weight: 700; font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}
.step__title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.step__desc { font-size: 0.85rem; font-weight: 300; line-height: 1.6; color: var(--text-secondary); }
.step__arrow { font-size: 1.5rem; color: var(--text-muted); margin-top: 36px; }

/* ── Integrations ── */
.integrations { display: flex; flex-direction: column; gap: var(--space-xs); max-width: 560px; }
.integration {
    display: flex; align-items: center; gap: var(--space-sm);
    width: 100%; padding: var(--space-sm) var(--space-md);
    background: transparent; border: 1px solid var(--border);
    border-radius: 14px; cursor: pointer; text-align: left;
    color: var(--text-primary);
    transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.2s var(--ease-spring);
    position: relative; overflow: hidden;
}
.integration::before {
    content: ''; position: absolute; left: 0; top: 0;
    width: 3px; height: 100%; background: var(--red-bright);
    transform: scaleY(0); transform-origin: bottom;
    transition: transform 0.3s var(--ease-out);
}
.integration:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-hover); transform: translateX(3px); }
.integration:hover:not(:disabled)::before { transform: scaleY(1); }
.integration:disabled { cursor: not-allowed; opacity: 0.6; }

.integration__icon-wrap {
    flex-shrink: 0; width: 42px; height: 42px;
    display: grid; place-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border); border-radius: 10px;
}
.integration__icon { width: 22px; height: 22px; object-fit: contain; }
.meta-icon { fill: #4267B2; }
.integration__info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.integration__label { font-size: 0.95rem; font-weight: 500; }
.integration__sub { font-size: 0.75rem; font-weight: 300; color: var(--text-secondary); }

.integration__action {
    flex-shrink: 0; position: relative;
    display: grid; place-items: center; min-width: 60px;
}
.action-text { font-size: 0.8rem; font-weight: 500; color: var(--red-bright); letter-spacing: 0.04em; transition: opacity 0.2s; }
.arrow-icon {
    position: absolute; color: var(--red-bright); opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.integration:hover:not(:disabled) .action-text { opacity: 0; }
.integration:hover:not(:disabled) .arrow-icon { opacity: 1; transform: translateX(0); }

.spinner {
    display: none; position: absolute;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--red-bright);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.integration.loading .action-text, .integration.loading .arrow-icon { display: none; }
.integration.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.integrations__security {
    display: flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-size: 0.75rem; font-weight: 300;
    margin-top: var(--space-sm);
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.footer {
    position: relative; z-index: 1;
    border-top: 1px solid var(--border);
    padding: var(--space-md);
}
.footer__inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: var(--space-sm);
}
.footer__brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; color: var(--text-muted);
}
.footer__links { display: flex; gap: var(--space-md); }
.footer__links a {
    font-size: 0.82rem; color: var(--text-muted); text-decoration: none;
    transition: color 0.2s;
}
.footer__links a:hover { color: var(--text-secondary); }

/* ══════════════════════════════════════
   BREAKEVEN PAGE
══════════════════════════════════════ */
.breakeven-layout {
    position: relative; z-index: 1;
    max-width: 720px; margin: 0 auto;
    padding: calc(var(--navbar-h) + var(--space-lg)) var(--space-md) var(--space-xl);
    display: flex; flex-direction: column; gap: var(--space-md);
}

.page-header { padding: var(--space-sm) 0 var(--space-xs); }
.page-overline {
    font-size: 0.7rem; font-weight: 500; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--red-bright); margin-bottom: 8px;
}
.page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700; line-height: 1.1; margin-bottom: 12px;
}
.page-title em { font-style: italic; color: var(--red-bright); }
.page-description {
    font-size: 0.9rem; font-weight: 300; line-height: 1.7;
    color: var(--text-secondary); max-width: 50ch;
}

/* ── Card ── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset, 0 24px 48px -12px rgba(0,0,0,0.6);
    overflow: hidden;
}
.card--danger { border-color: rgba(239, 68, 68, 0.2); }
.card__accent-line { height: 3px; width: 100%; background: linear-gradient(90deg, var(--red), var(--red-bright) 50%, transparent); }
.card__accent-line--danger { background: linear-gradient(90deg, var(--red-bright), #FF6B6B 50%, transparent); }
.card__inner { padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); }

/* ── Section title ── */
.section-title {
    font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
    display: flex; align-items: center; gap: 12px;
}
.section-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--red-muted); border: 1px solid rgba(239,68,68,0.3);
    color: var(--red-bright); font-family: var(--font-body);
    font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.section-number.danger { font-size: 1rem; }
.section-sub { font-family: var(--font-body); font-size: 0.75rem; font-weight: 300; color: var(--text-secondary); }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.grid-1 { display: grid; grid-template-columns: 1fr; }

/* ── Field ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.03em; }
.field-hint { font-weight: 300; color: var(--text-muted); font-size: 0.72rem; }
.input-wrap { display: flex; align-items: center; position: relative; }
.prefix { position: absolute; left: 12px; font-size: 0.85rem; color: var(--text-muted); pointer-events: none; font-weight: 500; }

input[type="number"] {
    width: 100%; padding: 10px 12px 10px 32px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border); border-radius: 10px;
    color: var(--text-primary); font-family: var(--font-body);
    font-size: 0.9rem; font-weight: 400;
    transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
    -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"]:focus { outline: none; border-color: var(--red-bright); background: rgba(239, 68, 68, 0.04); }
input[type="number"]::placeholder { color: var(--text-muted); }

/* ── Results ── */
.results-block { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.result-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-radius: 8px; border: 1px solid transparent;
}
.result-row:hover { background: rgba(255,255,255,0.02); }
.result-row.highlight { background: rgba(255,255,255,0.03); border-color: var(--border); margin-top: 4px; }
.result-row.highlight.danger { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); }
.result-label { font-size: 0.82rem; font-weight: 400; color: var(--text-secondary); }
.result-value { font-size: 0.95rem; font-weight: 500; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.result-row.highlight .result-value { color: var(--red-bright); font-weight: 700; }
.result-row.highlight.danger .result-value { color: #FF6B6B; }

/* ── Stop loss ── */
.stop-loss-desc {
    font-size: 0.85rem; font-weight: 300; color: var(--text-secondary); line-height: 1.6;
    padding: 12px 14px;
    background: rgba(239, 68, 68, 0.06); border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
}
.stop-loss-desc strong { color: #FF6B6B; font-weight: 500; }

.page-footer {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    color: var(--text-muted); font-size: 0.75rem; font-weight: 300;
    padding: var(--space-sm) 0;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
    .navbar__links, .navbar__cta { display: none; }
    .navbar__toggle { display: flex; }
    .hero { flex-direction: column; min-height: auto; padding-top: calc(var(--navbar-h) + var(--space-md)); }
    .hero__preview { display: none; }
    .steps { flex-direction: column; }
    .step__arrow { display: none; }
}
@media (max-width: 560px) {
    .grid-2 { grid-template-columns: 1fr; }
    .card__inner { padding: var(--space-md); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
