/* AVRL Cauldron download page. Tokens and components follow the AVRL brand
   (avrl.io and the Studio -> Mika sign-on page). */

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

:root {
    --paper: #f6f8fc;
    --paper-2: #eaf0f9;
    --card: #ffffff;
    --ink: #0e1e3a;
    --muted: #4f5d75;
    --rule: #d8e0ec;
    --quiet: #8392ab;
    --slate: #5e6b82;
    --navy: #0a2a5e;
    --navy-2: #0f3a7d;
    --blue: #1f5fd1;
    --blue-hover: #1a50b3;
    --blue-text: #1a4fb0;
    --blue-soft: #e7f0fe;
    --red: #b22234;
    --green: #17803d;
    --on-navy-muted: #bccbe3;
    --shadow-lift: 0 16px 36px -14px rgba(14, 30, 58, 0.25);
    --shadow-cta: 0 6px 16px -6px rgba(31, 95, 209, 0.55);
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

html { background: var(--navy); }

body {
    font-family: 'Google Sans Flex', system-ui, sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 72px;
    background: var(--navy);
    position: relative;
}

/* Flag stripe: navy half, blue to 85%, then red. 3px, top edge only. */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 3;
    background: linear-gradient(90deg, var(--navy) 0 50%, var(--blue) 50% 85%, var(--red) 85%);
}

.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 100% 0%, rgba(40, 101, 211, 0.45), transparent 30%), #133264;
}

.grid-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.12;
}

.logo-wrap {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 14px;
    animation: rise 0.6s cubic-bezier(.2, .7, .2, 1) both;
}
.logo-wrap img { height: 48px; filter: brightness(0) invert(1); }

.card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    padding: 34px 36px 30px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 14px;
    box-shadow: var(--shadow-lift), 0 2px 12px rgba(14, 30, 58, 0.12);
    animation: rise 0.6s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Product heading */
.product { text-align: center; margin-bottom: 26px; }
.product-icon {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 13px;
    box-shadow: 0 6px 14px -6px rgba(14, 30, 58, 0.45);
}
.brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.brand-sub { font-size: 0.88rem; color: var(--muted); }
.who { color: var(--ink); font-weight: 600; word-break: break-all; }

/* Inputs */
.field { position: relative; margin-bottom: 16px; }
.field input {
    width: 100%;
    padding: 14px 44px 14px 44px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--quiet);
    border-radius: 0.5rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--quiet); }
.field input:hover { border-color: var(--slate); }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.field .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--slate);
    pointer-events: none;
    transition: color .15s;
}
.field input:focus ~ .icon { color: var(--blue); }

.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate);
    padding: 3px;
    border-radius: 0.25rem;
    transition: color .15s;
}
.pw-toggle:hover { color: var(--navy); }
.pw-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.pw-toggle svg { width: 18px; height: 18px; display: block; }
.pw-toggle[aria-pressed="true"] { color: var(--blue); }

.hint { font-size: 0.78rem; line-height: 1.45; color: var(--muted); margin: -4px 0 20px; }
.hint.center { text-align: center; margin: 0 0 6px; }
.mono { font-family: var(--mono); font-size: 0.92em; }

/* Primary button */
.btn-primary {
    width: 100%;
    height: 2.875rem;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--blue);
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-cta);
    cursor: pointer;
    transition: background .25s ease, transform .3s cubic-bezier(.2, .7, .3, 1);
}
.btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn-primary[disabled] { opacity: 0.85; cursor: progress; transform: none; }
.btn-icon { width: 18px; height: 18px; }

.btn-primary .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
    text-align: center;
    color: var(--red);
    font-size: 0.85rem;
    min-height: 20px;
    margin-top: 14px;
}
.status-msg {
    text-align: center;
    color: var(--green);
    font-size: 0.85rem;
    min-height: 20px;
    margin-top: 12px;
}

/* Release card (ready state) */
.release {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 0.75rem;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.release-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.release-name { font-size: 1rem; font-weight: 700; color: var(--navy); }
.badge {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue-text);
    background: var(--blue-soft);
    border-radius: 999px;
    padding: 3px 9px;
}
.release-meta { margin-top: 4px; font-size: 0.8rem; color: var(--muted); }
.release-notes { margin-top: 10px; font-size: 0.85rem; line-height: 1.5; color: var(--ink); }
.release-notes:empty { display: none; }

.steps {
    margin: 8px 0 0 20px;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--muted);
}
.steps li { padding-left: 4px; margin-bottom: 8px; }
.steps strong { color: var(--ink); font-weight: 600; }

.checksum { margin-top: 10px; font-size: 0.8rem; color: var(--muted); }
.checksum summary {
    cursor: pointer;
    color: var(--blue-text);
    font-weight: 600;
    border-radius: 0.25rem;
}
.checksum summary:hover { color: var(--navy); }
.checksum summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.checksum-value {
    margin: 8px 0;
    padding: 8px 10px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 0.5rem;
    word-break: break-all;
    color: var(--ink);
    user-select: all;
}
.checksum .hint { margin: 0; }

/* Divider and footer */
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.divider span {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    white-space: nowrap;
}
.footer-links { text-align: center; }
.footer-links a {
    color: var(--blue-text);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: color .15s;
}
.footer-links a:hover { color: var(--navy); }
.footer-links a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.bottom-brand {
    position: fixed;
    bottom: 22px;
    left: 0; right: 0;
    text-align: center;
    z-index: 2;
    font-size: 0.75rem;
    color: var(--on-navy-muted);
}

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

@media (max-width: 480px) {
    body { padding: 40px 16px 64px; }
    .card { padding: 28px 22px 24px; }
    .bottom-brand { position: static; margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .card, .logo-wrap { animation: none; }
    .btn-primary:hover { transform: none; }
}
