/* Shared styles for every page: colour tokens (light and dark), header, buttons, forms, footer. */

:root {
  /* brand */
  --blue: #0F5BE6;
  --blue-dark: #0A47B8;
  --bright: #3D86FF;          /* the blue used on dark surfaces */
  --deep: #07142E;            /* ink navy: hero, programme band, footer (same in both themes) */
  --deep-2: #0C1F4A;

  /* surfaces and text, light */
  --bg: #FFFFFF;
  --surface: #EEF3FC;
  --card: #FFFFFF;
  --field: #FFFFFF;
  --head: #07142E;
  --text: #14233F;
  --muted: #4B5B78;
  --line: #D3DEF0;
  --line-strong: #B7C8E6;
  --band: #0F5BE6;
  --green: #0A7A47;
  --error: #B00020;
  --warn-bg: #FFF4CC; --warn-line: #E8C84A; --warn-text: #4A3B00;
  --shadow: 0 1px 2px rgba(7,20,46,.06), 0 12px 32px -8px rgba(7,20,46,.14);
  --logo-bg: transparent; --logo-pad: 0;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  /* older names still used by the pages */
  --navy: var(--head);
  --sky: var(--surface);
  --white: var(--bg);

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}

:root[data-theme="dark"] {
  --blue: #3D86FF;
  --blue-dark: #6AA3FF;
  --bg: #060D1F;
  --surface: #0C1733;
  --card: #0F1D3F;
  --field: #0A1530;
  --head: #F2F6FF;
  --text: #DCE5F8;
  --muted: #9DB0D3;
  --line: #1D2F5A;
  --line-strong: #2C447C;
  --band: #0B2A78;
  --green: #4FD08F;
  --error: #FF7A8E;
  --warn-bg: #3A2F08; --warn-line: #7A641A; --warn-text: #FFE9A0;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -10px rgba(0,0,0,.6);
  --logo-bg: #FFFFFF; --logo-pad: 5px 12px;
  color-scheme: dark;
}

/* Follow the phone or computer setting until the visitor picks one with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #3D86FF;
    --blue-dark: #6AA3FF;
    --bg: #060D1F;
    --surface: #0C1733;
    --card: #0F1D3F;
    --field: #0A1530;
    --head: #F2F6FF;
    --text: #DCE5F8;
    --muted: #9DB0D3;
    --line: #1D2F5A;
    --line-strong: #2C447C;
    --band: #0B2A78;
    --green: #4FD08F;
    --error: #FF7A8E;
    --warn-bg: #3A2F08; --warn-line: #7A641A; --warn-text: #FFE9A0;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -10px rgba(0,0,0,.6);
    --logo-bg: #FFFFFF; --logo-pad: 5px 12px;
    color-scheme: dark;
  }
}

html { scroll-padding-top: 80px; scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 18px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background-color .25s ease, color .25s ease; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.1; letter-spacing: -0.02em; color: var(--head); }
a { color: var(--blue); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--bright); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand-logo { display: block; flex: none; background: var(--logo-bg); padding: var(--logo-pad); border-radius: 10px; }
.brand-logo img { height: 46px; width: auto; mix-blend-mode: multiply; }
:root[data-theme="dark"] .brand-logo img { mix-blend-mode: normal; height: 38px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo img { mix-blend-mode: normal; height: 38px; } }
nav.links { display: flex; align-items: center; gap: 22px; font: 600 15px/1 var(--display); }
nav.links a { color: var(--text); text-decoration: none; }
nav.links a:not(.btn):hover { color: var(--blue); }
nav.links a.btn { color: #fff; }
@media (max-width: 800px) { nav.links a.hide-s { display: none; } }

.theme-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.theme-btn:hover { background: var(--surface); border-color: var(--blue); }
.theme-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

/* buttons */
.btn { display: inline-block; border: 0; cursor: pointer; text-decoration: none; font: 700 16px/1 var(--display); background: var(--blue); color: #fff; padding: 16px 26px; border-radius: 8px; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 8px 18px -8px rgba(15,91,230,.7); transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.btn:hover { background: var(--blue-dark); transform: translateY(-2px); }
:root[data-theme="dark"] .btn, :root[data-theme="dark"] nav.links a.btn { color: #04112B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn, :root:not([data-theme="light"]) nav.links a.btn { color: #04112B; } }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn.sm { padding: 12px 18px; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--blue); border: 2px solid var(--blue); padding: 14px 24px; box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--blue) 12%, transparent); }
:root[data-theme="dark"] .btn.ghost { color: var(--bright); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.ghost { color: var(--bright); } }
.btn.danger { background: transparent; color: var(--error); border: 2px solid var(--error); padding: 14px 24px; box-shadow: none; }
.btn.danger:hover { background: color-mix(in srgb, var(--error) 12%, transparent); }
.btn.linklike { background: none; color: var(--blue); padding: 6px 0; text-decoration: underline; font-weight: 600; box-shadow: none; }
.btn.linklike:hover { background: none; transform: none; }

/* forms */
label, legend { display: block; font: 700 15px/1.3 var(--display); margin: 0 0 6px; padding: 0; color: var(--head); }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=password], select, textarea {
  width: 100%; font: 400 17px/1.3 var(--display); color: var(--text); background: var(--field);
  border: 2px solid var(--line); border-radius: 8px; padding: 13px 14px; appearance: none; -webkit-appearance: none; min-height: 50px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
fieldset { border: 0; padding: 0; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.checks.two { grid-template-columns: repeat(2, 1fr); }
.check { display: flex; align-items: center; gap: 10px; font: 500 15px/1.3 var(--display); margin: 0; padding: 11px 12px; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--text); transition: border-color .15s ease, background .15s ease; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.check:has(input:checked) { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--card)); }
.hint { font: 400 14px/1.45 var(--display); color: var(--muted); margin: 0; }
.error { color: var(--error); font: 700 15px/1.4 var(--display); margin: 10px 0 0; min-height: 1.4em; }
.ok { color: var(--green); font: 700 15px/1.4 var(--display); margin: 10px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 10px; padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow); display: grid; gap: 18px; }

/* footer */
footer { margin-top: clamp(48px, 7vw, 90px); background: var(--deep); color: #C9D8F5; padding: 48px 0 calc(30px + env(safe-area-inset-bottom, 0px)); font: 400 15px/1.6 var(--display); position: relative; overflow: hidden; }
footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--bright), transparent 80%); }
footer a { color: #fff; }

.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 36px 56px; align-items: start; }
.foot-brand .brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font: 800 21px/1 var(--display); letter-spacing: -0.01em; }
.mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--blue); color: #fff; font: 900 16px/1 var(--display); box-shadow: 0 8px 20px -8px rgba(61,134,255,.9); }
:root[data-theme="dark"] .mark { color: #04112B; }
.foot-brand .tag { margin: 18px 0 4px; font: 800 24px/1.2 var(--display); color: #fff; letter-spacing: -0.015em; }
.foot-brand .sub { margin: 0; color: #9DB5E4; }
footer h4 { margin: 0 0 14px; font: 700 15px/1.3 var(--display); color: #fff; }
.foot-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot-nav a { text-decoration: none; color: #C9D8F5; transition: color .15s ease; }
.foot-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.soc { display: flex; flex-wrap: wrap; gap: 10px; }
.soc a { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); color: #fff; background: rgba(255,255,255,.05); transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.soc a:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-2px); }
.soc svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.foot-follow .handle { margin: 14px 0 0; font-size: 14px; color: #9DB5E4; }
footer .small { margin: 36px 0 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); font: 400 14px/1.6 var(--display); color: #9DB5E4; display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between; }
footer .small a { color: #C9D8F5; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr; gap: 30px; } }

@media (max-width: 640px) { body { font-size: 17px; } .row2, .checks, .checks.two { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .soc a, body { transition: none; } .btn:hover, .soc a:hover { transform: none; } }
