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

:root {
    /* Palette shared with the landing page (landing.css --landing-*). */
    --cr-bg: #000000;
    --cr-surface: #1d2026;
    --cr-surface-raised: #242830;
    --cr-field: #14161b;
    --cr-field-focus: #181b21;
    --cr-line: #30343c;
    --cr-line-strong: #434856;
    --cr-line-hover: rgba(70, 120, 249, 0.42);
    --cr-text: #f4f7fb;
    --cr-muted: #959cb1;
    --cr-subtle: #7a8196;
    --cr-accent: #376df9;
    --cr-accent-bright: #4678f9;
    --cr-accent-text: #8aa9ff;
    --cr-accent-ink: #ffffff;
    --cr-accent-gradient: linear-gradient(100deg, #376df9, #4678f9);
    --cr-accent-gradient-hover: linear-gradient(100deg, #2495ff, #41c1eb);
    --cr-secondary: #ff5fa0;
    --cr-success: #22c55e;
    --cr-danger: #ff9a9a;
    --cr-focus: rgba(70, 120, 249, 0.24);
    --cr-focus-ring: rgba(70, 120, 249, 0.9);
    --cr-radius: 8px;
    --cr-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    --cr-header-h: 68px;
    --cr-font-heading: 'Fira Sans', sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color-scheme: dark;
    background: var(--cr-bg);
    scroll-padding-top: calc(var(--cr-header-h) + 16px);
}

::selection {
    background: rgba(70, 120, 249, 0.45);
    color: #fff;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--cr-text);
    background-color: var(--cr-bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(145deg, rgba(55, 109, 249, 0.12), transparent 38%), linear-gradient(to left, #171717, #000000);
    background-size:
        48px 48px,
        48px 48px,
        100% 760px,
        100% 100%;
    background-repeat: repeat, repeat, no-repeat, no-repeat;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0;
}

button,
input,
select {
    font: inherit;
    letter-spacing: 0;
}

button,
a,
summary,
input {
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

.cr-skip {
    position: absolute;
    top: -64px;
    left: 16px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--cr-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: top 0.2s ease;
}

.cr-skip:focus {
    top: 12px;
}

/* Sticky header: transparent with a soft scrim at the top, glass bar once scrolled (matches the landing page). */
.cr-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    background-color: transparent;
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.cr-header::before {
    content: '';
    position: absolute;
    inset: 0 0 -24px;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cr-header.is-scrolled {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(13, 14, 18, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
}

.cr-header.is-scrolled::before {
    opacity: 0;
}

.cr-header-inner {
    width: min(1180px, calc(100% - 48px));
    min-height: var(--cr-header-h);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cr-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--cr-text);
    font-family: var(--cr-font-heading);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.cr-brand img {
    display: block;
    border-radius: 8px;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
    transition:
        filter 0.25s ease,
        transform 0.25s ease;
}

.cr-brand:hover img {
    filter: brightness(1.12) saturate(1.08) drop-shadow(0 8px 22px rgba(70, 120, 249, 0.35));
    transform: translateY(-2px);
}

.cr-back {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--cr-muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.cr-back::before {
    content: '←';
    margin-right: 8px;
}

.cr-back:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--cr-text);
}

.cr-page {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0 80px;
}

.cr-intro {
    max-width: 700px;
    margin-bottom: 42px;
    animation: cr-rise 420ms ease both;
}

.cr-eyebrow {
    margin: 0 0 14px;
    color: var(--cr-accent-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cr-title {
    margin: 0;
    font-family: var(--cr-font-heading);
    font-size: 46px;
    line-height: 1.12;
    text-wrap: balance;
    font-weight: 600;
    letter-spacing: 0;
}

.cr-lead {
    max-width: 600px;
    margin: 16px 0 0;
    color: var(--cr-muted);
    font-size: 17px;
    line-height: 1.7;
}

.cr-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 24px;
    align-items: start;
}

.cr-settings {
    min-width: 0;
    display: grid;
    gap: 16px;
}

.cr-section,
.cr-summary {
    border: 1px solid var(--cr-line);
    border-radius: var(--cr-radius);
    background: var(--cr-surface);
    box-shadow:
        var(--cr-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cr-section {
    padding: 28px;
    animation: cr-rise 420ms ease both;
}

.cr-section:nth-child(2) {
    animation-delay: 70ms;
}

.cr-section:nth-child(3) {
    animation-delay: 140ms;
}

.cr-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 26px;
}

.cr-section-heading h2,
.cr-summary h2 {
    margin: 0;
    font-family: var(--cr-font-heading);
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
}

.cr-section-heading p,
.cr-summary > p {
    margin: 5px 0 0;
    color: var(--cr-muted);
    font-size: 13px;
    line-height: 1.55;
}

.cr-step {
    width: 34px;
    height: 28px;
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(70, 120, 249, 0.38);
    border-radius: 4px;
    background: rgba(55, 109, 249, 0.12);
    color: var(--cr-accent-text);
    font-size: 11px;
    font-weight: 700;
}

.cr-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.cr-field-wide {
    grid-column: 1 / -1;
}

.cr-field {
    min-width: 0;
    display: grid;
    gap: 9px;
}

.cr-label {
    color: var(--cr-text);
    font-size: 13px;
    font-weight: 700;
}

.cr-optional {
    margin-left: 6px;
    color: var(--cr-subtle);
    font-size: 11px;
    font-weight: 600;
}

.cr-input {
    width: 100%;
    height: 48px;
    min-width: 0;
    padding: 0 14px;
    border: 1px solid var(--cr-line);
    border-radius: 6px;
    outline: none;
    background: var(--cr-field);
    color: var(--cr-text);
    font-size: 14px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.cr-input::placeholder {
    color: #6a6f82;
}

.cr-input:hover {
    border-color: var(--cr-line-strong);
    background: var(--cr-field-focus);
}

.cr-input:focus {
    border-color: var(--cr-accent);
    box-shadow:
        0 0 0 3px rgba(70, 120, 249, 0.2),
        inset 0 1px 2px rgba(0, 0, 0, 0.2);
    background: var(--cr-field-focus);
}

.cr-input-wrap {
    position: relative;
}

.cr-input-wrap .cr-input {
    padding-right: 106px;
}

.cr-input-action {
    position: absolute;
    top: 6px;
    right: 6px;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 4px;
    background: var(--cr-surface-raised);
    color: var(--cr-text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 160ms ease,
        color 160ms ease;
}

.cr-input-action:hover {
    background: var(--cr-accent-gradient);
    color: var(--cr-accent-ink);
}

.cr-input-action:focus-visible,
.cr-copy:focus-visible,
.cr-submit:focus-visible,
.cr-back:focus-visible,
.cr-brand:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--cr-focus-ring);
    outline-offset: 3px;
}

.cr-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cr-toggle {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 15px;
    border: 1px solid var(--cr-line);
    border-radius: 6px;
    background: #191c22;
    cursor: pointer;
    user-select: none;
    transition:
        border-color 160ms ease,
        background 160ms ease;
}

.cr-toggle:hover,
.cr-toggle:focus-within {
    border-color: var(--cr-line-hover);
    background: var(--cr-surface-raised);
}

.cr-option-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.cr-option-copy strong {
    font-size: 13px;
    line-height: 1.25;
}

.cr-option-copy small {
    color: var(--cr-subtle);
    font-size: 11px;
    line-height: 1.3;
}

.cr-switch-wrap {
    position: relative;
    width: 64px;
    height: 26px;
    flex: 0 0 64px;
}

.cr-switch-wrap input {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.cr-switch {
    position: absolute;
    inset: 0;
    border: 1px solid var(--cr-line-strong);
    border-radius: 999px;
    background: #2a2e36;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.cr-switch::before {
    content: 'OFF';
    position: absolute;
    top: 50%;
    right: 7px;
    color: var(--cr-text);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-50%);
}

.cr-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dde3ee;
    transition:
        left 160ms ease,
        background 160ms ease;
}

.cr-switch-wrap input:checked + .cr-switch {
    border-color: transparent;
    background: var(--cr-accent-gradient);
    box-shadow: 0 4px 14px rgba(55, 109, 249, 0.3);
}

.cr-switch-wrap input:checked + .cr-switch::before {
    content: 'ON';
    right: auto;
    left: 8px;
    color: var(--cr-accent-ink);
}

.cr-switch-wrap input:checked + .cr-switch::after {
    left: 41px;
    background: var(--cr-accent-ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cr-switch-wrap input:focus-visible + .cr-switch {
    box-shadow: 0 0 0 4px var(--cr-focus);
}

.cr-duration {
    max-width: 310px;
    margin-top: 22px;
}

.cr-duration-custom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cr-duration-custom[hidden] {
    display: none;
}

.cr-duration-part {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cr-subtle);
    font-size: 12px;
}

.cr-duration-part .cr-input {
    flex: 1 1 0;
    width: auto;
}

.cr-hint,
.cr-privacy {
    margin: 0;
    color: var(--cr-subtle);
    font-size: 11px;
    line-height: 1.5;
}

.cr-advanced {
    padding: 0;
}

.cr-advanced summary {
    min-height: 88px;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    list-style: none;
    cursor: pointer;
}

.cr-advanced summary::-webkit-details-marker {
    display: none;
}

.cr-advanced summary > span:nth-child(2) {
    display: grid;
    gap: 4px;
}

.cr-advanced summary strong {
    font-size: 15px;
}

.cr-advanced summary small {
    color: var(--cr-muted);
    font-size: 12px;
}

.cr-chevron {
    width: 9px;
    height: 9px;
    margin-left: auto;
    border-right: 2px solid var(--cr-muted);
    border-bottom: 2px solid var(--cr-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
}

.cr-advanced[open] .cr-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.cr-advanced-fields {
    padding: 0 28px 28px 78px;
}

.cr-summary {
    position: sticky;
    top: calc(var(--cr-header-h) + 16px);
    padding: 28px;
    overflow: hidden;
    animation: cr-rise 420ms 100ms ease both;
}

.cr-summary::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--cr-accent), var(--cr-accent-bright), var(--cr-secondary));
}

.cr-summary-status {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cr-success);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.cr-summary-status span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cr-success);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.cr-preview {
    height: 86px;
    margin-top: 20px;
    padding: 12px;
    color: #c7cede;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 11px;
    text-overflow: ellipsis;
}

.cr-actions {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cr-actions:has(.cr-share[hidden]) {
    grid-template-columns: 1fr;
}

.cr-copy {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--cr-line-strong);
    border-radius: 5px;
    background: var(--cr-surface-raised);
    color: var(--cr-text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        background 160ms ease;
}

.cr-copy:only-child {
    grid-column: 1 / -1;
}

.cr-copy:hover:not(:disabled) {
    border-color: rgba(70, 120, 249, 0.5);
    background: #2b303a;
}

.cr-copy:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cr-qr-wrap {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--cr-line);
    border-radius: 6px;
    display: grid;
    gap: 12px;
    place-items: center;
    background: var(--cr-field);
}

.cr-qr {
    width: 180px;
    height: 180px;
    padding: 10px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    background: #ffffff;
}

.cr-qr canvas,
.cr-qr img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.cr-qr-hint {
    text-align: center;
}

.cr-status,
.cr-error {
    min-height: 18px;
    margin: 12px 0 0;
    font-size: 11px;
    line-height: 1.5;
}

.cr-status {
    color: var(--cr-success);
}

.cr-error {
    color: var(--cr-danger);
}

.cr-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--cr-accent-gradient);
    box-shadow: 0 10px 26px rgba(22, 140, 255, 0.24);
    color: var(--cr-accent-ink);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition:
        background 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.cr-submit:hover {
    background: var(--cr-accent-gradient-hover);
    box-shadow: 0 12px 30px rgba(22, 140, 255, 0.34);
    transform: translateY(-1px);
}

.cr-submit:active {
    transform: translateY(0) scale(0.985);
}

.cr-submit span {
    font-size: 20px;
    line-height: 1;
}

.cr-privacy {
    margin-top: 14px;
    text-align: center;
}

.cr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes cr-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 920px) {
    .cr-layout {
        grid-template-columns: 1fr;
    }

    .cr-summary {
        position: relative;
        top: 0;
    }

    .cr-preview {
        height: 58px;
    }
}

@media (max-width: 620px) {
    .cr-header-inner,
    .cr-page {
        width: min(100% - 28px, 1180px);
    }

    .cr-header-inner {
        min-height: 64px;
    }

    .cr-brand span {
        display: none;
    }

    .cr-page {
        padding: 42px 0 56px;
    }

    .cr-intro {
        margin-bottom: 28px;
    }

    .cr-title {
        font-size: 34px;
    }

    .cr-lead {
        font-size: 15px;
        line-height: 1.6;
    }

    .cr-section,
    .cr-summary {
        padding: 22px 18px;
    }

    .cr-field-grid,
    .cr-toggle-grid {
        grid-template-columns: 1fr;
    }

    .cr-field-wide {
        grid-column: auto;
    }

    .cr-duration {
        max-width: none;
    }

    .cr-advanced {
        padding: 0;
    }

    .cr-advanced summary {
        padding: 20px 18px;
    }

    .cr-advanced-fields {
        padding: 0 18px 22px;
    }
}

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

@media (forced-colors: active) {
    .cr-section,
    .cr-summary,
    .cr-toggle,
    .cr-input {
        forced-color-adjust: auto;
    }
}
