/* Healthcare Events UK - base stylesheet.
   Follows DESIGN.md: Poppins headings, Quicksand body, brand blue + magenta. */

:root {
    --blue: #0072EF;
    --blue-dark: #0061D5;
    --blue-pressed: #004C9F;
    --navy: #202832;
    --navy-deep: #182E45;
    --navy-deeper: #263238;
    --magenta: #EB3569;
    --magenta-dark: #D82D5F;
    --light-blue: #DEEEFF;
    --surface: #F5F8FA;
    --border: #CBD6E2;
    --border-light: #CCCCCC;
    --muted: #808080;
    --text: #202832;
    --white: #FFFFFF;
    --warning: #FCE301;
    --font-head: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); margin: 0 0 16px; }
h1 { font-size: 58px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 26px; font-weight: 600; line-height: 1.2; }
h3 { font-size: 26px; font-weight: 300; line-height: 1.1; }

p { margin: 0 0 16px; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 52px; }

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--navy); color: var(--white); padding: 12px 16px;
}
.skip-link:focus { left: 16px; top: 16px; z-index: 100; }

/* Header */
.site-header { background: var(--navy-deep); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.site-header__inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 70px; padding: 12px 52px;
}
.site-header__logo {
    font-family: var(--font-head); font-weight: 700; font-size: 20px;
    color: var(--white); text-decoration: none;
}
.site-header__logo span { color: var(--magenta); }
.site-header__nav { display: flex; gap: 8px; }
.site-header__nav a {
    color: var(--white); padding: 8px 16px; border-radius: 4px;
    font-family: var(--font-body); font-weight: 600; font-size: 14px;
}
.site-header__nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-body); font-weight: 700; text-decoration: none;
    border-radius: 100px; padding: 12px 16px; height: 47px; min-width: 200px;
    line-height: 21px; cursor: pointer; border: 1px solid transparent;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
    font-size: 16px;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn--primary:hover { background: var(--blue-dark); color: var(--white); }
.btn--primary:active { background: var(--blue-pressed); }
.btn--primary-large {
    background: var(--magenta); color: var(--white); border-color: var(--magenta);
    height: 60px; padding: 16px 20px; font-size: 20px; font-weight: 600; line-height: 26px;
    min-width: 280px;
}
.btn--primary-large:hover { background: var(--magenta-dark); color: var(--white); }
.btn--ghost {
    background: transparent; color: var(--white); border: 3px solid var(--white);
    height: 51px; font-weight: 600;
}
.btn--ghost:hover { background: rgba(255,255,255,.1); color: var(--white); }
.btn--header-cta {
    background: var(--blue); color: var(--white); border: none;
    height: auto; min-width: 0; padding: 10px 20px; font-size: 14px; font-weight: 600;
}
.btn--header-cta:hover { background: var(--blue-dark); color: var(--white); }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
    color: var(--white);
    padding: 72px 52px;
    min-height: 600px;
    display: flex; align-items: center;
}
.hero__inner { max-width: 1200px; margin: 0 auto; width: 100%; }
.hero__badge {
    display: inline-block; background: var(--magenta); color: var(--white);
    border-radius: 100px; padding: 8px 16px;
    font-size: 14px; font-weight: 600; margin-bottom: 24px;
}
.hero h1 { color: var(--white); max-width: 900px; }
.hero__lede { font-size: 20px; max-width: 720px; margin-bottom: 36px; opacity: .95; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Sections */
.section { padding: 72px 0; }
.section--alt { background: var(--surface); }
.section--error { padding: 96px 0; text-align: center; }
.section__lede { color: var(--muted); margin-bottom: 32px; }

/* Error pages */
.error__code {
    font-family: var(--font-head); font-weight: 700;
    color: var(--magenta); font-size: 120px; line-height: 1; margin: 0;
}

/* Footer */
.site-footer { background: var(--navy); color: var(--white); padding: 36px 0; margin-top: 72px; }
.site-footer__inner {
    max-width: 1200px; margin: 0 auto; padding: 0 52px;
    display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.site-footer a { color: var(--white); margin-left: 20px; font-weight: 600; }
.site-footer a:first-child { margin-left: 0; }

/* Section headers */
.section__header {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 32px;
}
.section__header h2 { margin: 0; }
.section__link { font-family: var(--font-body); font-weight: 600; }

/* Hero - search wrapper */
.hero__search {
    margin-top: 32px; background: rgba(255,255,255,.08);
    padding: 20px; border-radius: 12px;
}

/* Search bar */
.search-bar {}
.search-bar__row {
    display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; align-items: end;
}
.search-bar__field { display: flex; flex-direction: column; grid-column: span 3; }
.search-bar__field--grow     { grid-column: span 12; }
.search-bar__field--postcode { grid-column: span 3; }
.search-bar__field--radius   { grid-column: span 2; }
.search-bar__field--submit   { grid-column: span 4; }
.search-bar__field label {
    font-family: var(--font-body); font-size: 14px; font-weight: 600;
    color: var(--white); margin-bottom: 6px;
}
.search-bar__field input,
.search-bar__field select {
    background: var(--surface); color: #334B5B;
    font-family: var(--font-body); font-weight: 400; font-size: 16px;
    height: 46px; padding: 9px 12px;
    border: 2px solid var(--border); border-radius: 4px;
    width: 100%; box-sizing: border-box;
}
.search-bar__field input:focus,
.search-bar__field select:focus {
    outline: none; border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,114,239,.15);
}
.search-bar__field--submit .btn { height: 46px; width: 100%; min-width: 0; }

/* Search bar when not on dark background (search results page) */
.search-bar-wrap {
    background: var(--navy-deep); padding: 24px; border-radius: 12px; margin-bottom: 32px;
}

/* Search results */
.search-results__header { margin-bottom: 24px; }
.search-results__meta {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; margin: 16px 0 24px; flex-wrap: wrap;
}
.search-results__sort label { font-weight: 600; margin-right: 8px; }
.search-results__sort select {
    height: 40px; padding: 4px 12px; border-radius: 4px;
    border: 2px solid var(--border); background: var(--white);
    font-family: var(--font-body); font-size: 16px;
}
.search-results__empty {
    text-align: center; padding: 60px 20px;
    background: var(--surface); border-radius: 12px;
}

/* Event grid + cards */
.event-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.event-grid--results { grid-template-columns: repeat(3, 1fr); }
.event-card {
    background: var(--white); border: 1px solid var(--border-light);
    border-radius: 12px; padding: 24px;
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex; flex-direction: column;
}
.event-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.event-card__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.event-card__badge {
    background: var(--light-blue); color: var(--blue);
    font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 100px;
}
.event-card__badge--virtual { background: #FCE6EF; color: var(--magenta); }
.event-card__badge--both    { background: #E4F2E7; color: #1E7A3B; }
.event-card__category {
    background: var(--surface); color: var(--muted);
    font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 100px;
}
.event-card__title { font-size: 18px; font-weight: 600; margin: 0 0 8px; line-height: 1.3; }
.event-card__title a { color: var(--navy); text-decoration: none; }
.event-card__title a:hover { color: var(--blue); text-decoration: none; }
.event-card__date { color: var(--text); font-size: 14px; margin: 0 0 4px; }
.event-card__organiser { color: var(--muted); margin-left: 8px; }
.event-card__location { color: var(--muted); font-size: 14px; margin: 0; }
.event-card__distance {
    display: inline-block; margin-left: 8px;
    color: var(--blue); font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex; justify-content: center; align-items: center; gap: 16px;
    margin-top: 40px;
}
.pagination__link {
    padding: 10px 20px; border-radius: 100px;
    background: var(--blue); color: var(--white);
    font-weight: 600; text-decoration: none;
}
.pagination__link:hover { background: var(--blue-dark); color: var(--white); text-decoration: none; }
.pagination__current { color: var(--muted); font-weight: 600; }

/* Alerts */
.alert {
    padding: 16px 20px; border-radius: 8px; margin-bottom: 24px;
    font-size: 15px;
}
.alert--error { background: #FCE6EF; color: #8B1538; border: 1px solid #F4C0CF; }
.alert ul { margin: 8px 0 0 20px; padding: 0; }

/* Event detail */
.event-detail { padding: 48px 0 72px; }
.event-detail__back { margin-bottom: 16px; }
.event-detail__header { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border-light); }
.event-detail__header h1 { font-size: 40px; line-height: 1.2; margin: 16px 0 8px; }
.event-detail__organiser { color: var(--muted); }
.event-detail__grid {
    display: grid; grid-template-columns: 2fr 1fr; gap: 48px; align-items: start;
}
.event-detail__panel {
    background: var(--surface); padding: 24px; border-radius: 12px;
    margin-bottom: 16px;
}
.event-detail__panel h3 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.event-detail__panel--muted { background: var(--light-blue); font-size: 14px; color: var(--navy); }
.event-detail__panel address { font-style: normal; line-height: 1.6; }

/* Visually hidden (a11y) */
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container--narrow { max-width: 720px; }

/* Sign-up progress bar */
.signup-progress {
    list-style: none; padding: 0; margin: 0 0 48px;
    display: flex; gap: 8px; counter-reset: step;
}
.signup-progress__step {
    flex: 1; display: flex; align-items: center; gap: 12px;
    padding: 16px; border-radius: 12px; background: var(--surface);
    border: 2px solid var(--border-light); color: var(--muted);
    font-weight: 600;
}
.signup-progress__num {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--white); border: 2px solid var(--border-light);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-head); font-weight: 700;
}
.signup-progress__step--current {
    background: var(--light-blue); border-color: var(--blue); color: var(--blue);
}
.signup-progress__step--current .signup-progress__num {
    background: var(--blue); color: var(--white); border-color: var(--blue);
}
.signup-progress__step--done {
    background: var(--white); border-color: var(--blue); color: var(--blue);
}
.signup-progress__step--done .signup-progress__num {
    background: var(--blue); color: var(--white); border-color: var(--blue);
}

/* Signup layout */
.signup__header { margin-bottom: 32px; }
.signup__actions {
    display: flex; gap: 16px; justify-content: flex-end; align-items: center;
    margin-top: 32px; flex-wrap: wrap;
}

/* Pricing grid */
.pricing-grid {
    border: 0; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.pricing-card {
    background: var(--white); border: 2px solid var(--border-light);
    border-radius: 12px; padding: 24px;
    display: flex; flex-direction: column; gap: 16px;
    cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    position: relative;
}
.pricing-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.pricing-card.is-selected {
    border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,114,239,.15);
}
.pricing-card__radio {
    position: absolute; opacity: 0; pointer-events: none;
}
.pricing-card__name { font-size: 22px; font-weight: 600; margin: 0 0 8px; color: var(--navy); }
.pricing-card__price { margin: 0 0 8px; }
.pricing-card__price strong { font-family: var(--font-head); font-size: 32px; font-weight: 700; color: var(--navy); }
.pricing-card__price span { color: var(--muted); }
.pricing-card__limit { color: var(--muted); font-size: 14px; margin: 0; }
.pricing-card__features { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.pricing-card__features li {
    padding: 6px 0 6px 22px; position: relative; color: var(--text);
}
.pricing-card__features li::before {
    content: "\2713"; position: absolute; left: 0; top: 6px;
    color: var(--blue); font-weight: 700;
}
.pricing-card__features li.is-highlight { font-weight: 600; color: var(--navy); }
.pricing-card__feature-value { color: var(--muted); margin-left: 4px; }
.pricing-card__cta {
    display: block; text-align: center;
    padding: 10px 16px; border-radius: 100px;
    background: var(--surface); color: var(--navy);
    font-weight: 600; font-size: 14px;
    margin-top: auto;
}
.pricing-card.is-selected .pricing-card__cta { background: var(--blue); color: var(--white); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row--two > .form-field { flex: 1; min-width: 200px; }
.form-field { display: flex; flex-direction: column; }
.form-field label {
    font-family: var(--font-body); font-weight: 600; font-size: 14px;
    color: var(--navy); margin-bottom: 6px;
}
.form-field__meta { color: var(--muted); font-weight: 400; }
.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=tel],
.form-field input[type=password],
.form-field input[type=search],
.form-field input[type=date],
.form-field select {
    background: var(--surface); color: #334B5B;
    font-family: var(--font-body); font-size: 18px; font-weight: 400;
    height: 46px; padding: 9px 12px;
    border: 2px solid var(--border); border-radius: 4px; width: 100%;
    box-sizing: border-box;
}
.form-field input:focus,
.form-field select:focus {
    outline: none; border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,114,239,.15);
}
.form-field.is-invalid input,
.form-field.is-invalid select {
    border-color: var(--magenta);
    box-shadow: 0 0 0 3px rgba(235,53,105,.15);
}
.form-field__hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.form-field__error { color: var(--magenta); font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.form-field--checkbox { flex-direction: row; align-items: flex-start; gap: 10px; }
.form-field--checkbox label { font-weight: 400; font-size: 15px; }
.form-field--checkbox input { width: 18px; height: 18px; margin-top: 2px; }

/* Password strength meter */
.password-strength { margin-top: 10px; }
.password-strength__bar {
    background: var(--surface); border: 1px solid var(--border-light);
    height: 8px; border-radius: 100px; overflow: hidden;
}
.password-strength__bar span {
    display: block; height: 100%; width: 0; background: var(--magenta);
    transition: width .2s ease, background .2s ease;
}
.password-strength__label { color: var(--muted); font-size: 13px; margin: 6px 0; }
.password-strength__rules {
    list-style: none; padding: 0; margin: 4px 0 0;
    display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--muted);
}
.password-strength__rules li::before {
    content: "\2715"; color: var(--magenta); margin-right: 4px; font-weight: 700;
}
.password-strength__rules li.is-ok { color: var(--navy); }
.password-strength__rules li.is-ok::before { content: "\2713"; color: #1E7A3B; }

/* Ghost button on light background (used in signup back button) */
.btn--ghost-dark {
    background: transparent; color: var(--navy); border: 2px solid var(--navy);
    height: 51px; font-weight: 600;
}
.btn--ghost-dark:hover { background: var(--navy); color: var(--white); }

/* Payment summary + dashboard panels */
.payment-summary {
    background: var(--surface); padding: 24px; border-radius: 12px;
    border: 1px solid var(--border-light); margin: 24px 0;
}
.payment-summary h2 { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
.payment-summary__list {
    margin: 0; display: grid; grid-template-columns: max-content 1fr;
    column-gap: 24px; row-gap: 8px;
}
.payment-summary__list dt { color: var(--muted); font-weight: 600; }
.payment-summary__list dd { margin: 0; color: var(--navy); }
.payment-summary ol { padding-left: 20px; margin: 0; }
.payment-summary ol li { padding: 4px 0; }
.payment-note { font-size: 13px; color: var(--muted); }
.signup__actions--centred { justify-content: center; }
.signup__header--centred  { text-align: center; }
.signup__tick {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: #E4F2E7; color: #1E7A3B; font-size: 32px; font-weight: 700;
    margin: 0 auto 16px;
}

/* Auth cards (login / forgot / reset / verify result) */
.auth-card {
    background: var(--white); padding: 40px 32px; border-radius: 12px;
    border: 1px solid var(--border-light); margin-top: 32px; text-align: left;
}
.auth-card h1 { font-size: 32px; }
.auth-card__actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-top: 16px;
}
.auth-card__link { font-weight: 600; }
.auth-card__alt { margin-top: 32px; color: var(--muted); text-align: center; }

/* Responsive */
@media (max-width: 1023px) {
    .container, .site-header__inner, .site-footer__inner, .hero { padding-left: 32px; padding-right: 32px; }
    .hero { padding-top: 52px; padding-bottom: 52px; min-height: 400px; }
    h1 { font-size: 40px; line-height: 50px; }
    .section { padding: 48px 0; }
    .event-grid, .event-grid--results { grid-template-columns: repeat(2, 1fr); }
    .search-bar__field { grid-column: span 6; }
    .search-bar__field--grow { grid-column: span 12; }
    .event-detail__grid { grid-template-columns: 1fr; gap: 24px; }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .signup-progress__label { display: none; }
    .signup-progress__step { justify-content: center; }
}
@media (max-width: 767px) {
    .container, .site-footer__inner { padding-left: 16px; padding-right: 16px; }
    .site-header__inner { padding: 12px 16px; height: auto; flex-wrap: wrap; gap: 12px; }
    .site-header__nav { order: 3; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .hero { padding: 36px 16px; min-height: 300px; }
    h1 { font-size: 32px; line-height: 1.2; }
    .hero__lede { font-size: 18px; }
    .btn, .btn--primary-large { width: 100%; min-width: 0; }
    .hero__actions { flex-direction: column; }
    .section { padding: 36px 0; }
    .event-grid, .event-grid--results { grid-template-columns: 1fr; }
    .search-bar__field { grid-column: span 12; }
    .event-detail__header h1 { font-size: 28px; }
    .pricing-grid { grid-template-columns: 1fr; }
    .signup__actions { flex-direction: column-reverse; align-items: stretch; }
    .signup__actions .btn { width: 100%; }
}
