/**
 * Talk Native — redesign shell (Phase A)
 * Load after layout.css when migrating pages, or alone on new-shell pages.
 * Brand teal: #008c9f
 */

:root {
  --tn-teal: #008c9f;
  --tn-teal-dark: #006f7e;
  --tn-teal-soft: rgba(0, 140, 159, 0.14);
  --tn-cyan: #eef7f8;
  --tn-ink: #1a1a1a;
  --tn-muted: #5a5a5a;
  --tn-line: #e2e8ea;
  --tn-white: #ffffff;
  --tn-max: 1120px;
  --tn-radius: 12px;
  --tn-shadow: 0 4px 20px rgba(0, 60, 70, 0.08);
  --tn-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Reset / base when body.tn-shell --- */
body.tn-shell {
  margin: 0;
  padding: 0;
  width: 100% !important;
  max-width: none !important;
  font-family: var(--tn-font);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--tn-ink);
  background: var(--tn-white);
  -webkit-font-smoothing: antialiased;
}

/* Responsive content images. Logo/flag rules below must beat this (higher specificity). */
body.tn-shell img {
  max-width: 100%;
  height: auto;
}

.tn-wrap {
  width: 100%;
  max-width: var(--tn-max);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Header + footer chrome — slightly wider than page content so they match */
.tn-header .tn-wrap,
.tn-footer .tn-wrap,
.tn-wrap-wide {
  max-width: 1280px;
}

/* --- Typography --- */
.tn-shell h1,
.tn-shell h2,
.tn-shell h3 {
  font-family: var(--tn-font);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tn-ink);
  margin: 0 0 0.6em;
  line-height: 1.25;
}

.tn-shell h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); color: var(--tn-teal); }
.tn-shell h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
.tn-shell h3 { font-size: 1.15rem; color: var(--tn-teal); }

/* Lead copy: left by default (forms/contact). Center only in hero / .tn-text-center. */
.tn-shell p.tn-lead,
.tn-shell .tn-lead {
  font-size: 1.1rem;
  color: var(--tn-muted);
  max-width: 40em;
  width: 100%;
  margin-top: 0;
  margin-bottom: 1.5rem;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
  display: block;
  box-sizing: border-box;
}

body.tn-shell .tn-hero .tn-lead,
body.tn-shell .tn-text-center .tn-lead,
body.tn-shell p.tn-lead.tn-text-center,
body.tn-shell .tn-lead.tn-text-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.tn-text-center { text-align: center; }
.tn-text-left { text-align: left; }
.tn-muted { color: var(--tn-muted); }
.tn-teal { color: var(--tn-teal); }

.tn-shell p {
  margin: 0 0 1em;
}

.tn-shell a {
  color: var(--tn-teal);
  text-decoration: none;
}

/* Exclude CTA buttons — nav hover is handled separately (pale teal pill) */
.tn-shell a:not(.tn-btn):hover {
  text-decoration: underline;
  background: transparent;
  color: var(--tn-teal-dark);
}

/* --- Header --- */
/* One row: logo | expanding space | nav | language (vertically centered) */
.tn-header {
  border-bottom: 1px solid var(--tn-line);
  background: var(--tn-white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tn-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 12px 0;
  flex-wrap: nowrap;
}

.tn-logo {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

/* Original logo (webp) — header only */
body.tn-shell .tn-logo img,
.tn-logo img {
  width: auto;
  height: 73px;
  max-width: 320px;
  object-fit: contain;
  display: block;
}

.tn-header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

body.tn-shell .tn-lang img,
.tn-lang img {
  width: 28px;
  height: auto;
  max-width: 28px;
  display: block;
  border-radius: 2px;
}

/* margin-left: auto creates the expanding filler between logo and nav */
.tn-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 8px;
  margin-left: auto;
  width: auto;
  max-width: none;
  padding: 0;
  min-width: 0;
}

.tn-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--tn-ink);
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Pale teal pill — same shape as active item, softer fill */
body.tn-shell .tn-nav a:hover,
.tn-nav a:hover {
  background: var(--tn-teal-soft) !important;
  color: var(--tn-teal-dark) !important;
  text-decoration: none !important;
}

.tn-nav a.is-active {
  background: var(--tn-teal);
  color: var(--tn-white);
}

body.tn-shell .tn-nav a.is-active:hover,
.tn-nav a.is-active:hover {
  background: var(--tn-teal-dark) !important;
  color: var(--tn-white) !important;
  text-decoration: none !important;
}

.tn-nav-toggle {
  display: none;
  border: 1px solid var(--tn-line);
  background: var(--tn-white);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 1.25rem;
  color: var(--tn-teal);
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 768px) {
  .tn-header-inner {
    flex-wrap: wrap;
  }
  .tn-nav-toggle { display: block; }
  /* Keep logo + tools on first row; nav opens full-width below */
  .tn-header-tools {
    margin-left: auto;
  }
  .tn-nav {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-bottom: 8px;
  }
  .tn-nav.is-open { display: flex; }
  .tn-nav a { text-align: right; }
}

/* --- Buttons --- */
.tn-btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--tn-font);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none !important;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 60, 70, 0.12);
  transition:
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.tn-btn-primary {
  background: var(--tn-teal);
  color: var(--tn-white) !important;
  border-color: var(--tn-teal);
}

.tn-btn-primary:hover,
.tn-btn-primary:focus {
  background: var(--tn-teal-dark) !important;
  border-color: var(--tn-teal-dark);
  color: var(--tn-white) !important;
  text-decoration: none;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 60, 70, 0.22);
}

.tn-btn-secondary {
  background: var(--tn-white);
  color: var(--tn-teal) !important;
  border-color: var(--tn-teal);
}

.tn-btn-secondary:hover,
.tn-btn-secondary:focus {
  background: var(--tn-cyan) !important;
  color: var(--tn-teal-dark) !important;
  text-decoration: none;
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0, 60, 70, 0.16);
}

/* Emphasised CTA (e.g. Apply Now) — same shell colours/pill, extra weight */
.tn-btn-cta {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 200px;
}

.tn-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 1.5rem 0;
}

.tn-btn:disabled,
.tn-btn[disabled] {
  opacity: 0.65;
  cursor: wait;
  transform: none !important;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .tn-btn {
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .tn-btn-primary:hover,
  .tn-btn-primary:focus,
  .tn-btn-secondary:hover,
  .tn-btn-secondary:focus {
    transform: none;
  }
}

/* --- Hero --- */
.tn-hero {
  background: linear-gradient(165deg, var(--tn-cyan) 0%, var(--tn-white) 55%);
  padding: 48px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--tn-line);
}

.tn-hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tn-teal);
  background: var(--tn-white);
  border: 1px solid var(--tn-line);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 1rem;
}

/* --- Cards / grid --- */
.tn-section {
  padding: 48px 0;
}

.tn-section-alt {
  background: var(--tn-cyan);
}

.tn-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 1.5rem;
}

@media (min-width: 769px) {
  .tn-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tn-card {
  background: var(--tn-white);
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius);
  padding: 24px 22px;
  box-shadow: var(--tn-shadow);
  text-align: left;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.tn-card h3 {
  margin-top: 0;
}

.tn-card p:last-child {
  margin-bottom: 0;
}

/* Push actions to bottom so buttons line up across equal-height cards */
.tn-card-actions {
  margin-top: auto;
  padding-top: 1rem;
}

.tn-card-actions .tn-btn {
  width: 100%;
  box-sizing: border-box;
}

.tn-card-actions .tn-form-note {
  margin: 0.75rem 0 0;
}

.tn-card-icon {
  font-size: 1.75rem;
  color: var(--tn-teal);
  margin-bottom: 0.5rem;
}

.tn-duo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 1.25rem;
}

@media (min-width: 600px) {
  .tn-duo {
    grid-template-columns: 1fr 1fr;
  }
}

.tn-duo-box {
  background: var(--tn-white);
  border-radius: var(--tn-radius);
  padding: 20px;
  border-top: 4px solid var(--tn-teal);
  box-shadow: var(--tn-shadow);
}

/* --- Page intro (forms / contact) --- */
.tn-page-intro {
  padding: 36px 0 8px;
  text-align: left;
}

.tn-page-intro h1 {
  margin-bottom: 0.5rem;
}

/* --- Forms --- */
.tn-form-card {
  background: var(--tn-white);
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius);
  box-shadow: var(--tn-shadow);
  padding: 28px 24px;
  margin: 1.25rem 0 2rem;
  box-sizing: border-box;
}

.tn-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 28px;
}

@media (min-width: 700px) {
  .tn-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tn-field {
  margin-bottom: 1.1rem;
}

.tn-field label,
.tn-form label.tn-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--tn-ink);
  margin: 0 0 0.4rem;
}

.tn-field-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--tn-muted);
  margin-top: 0.35rem;
}

body.tn-shell .tn-form input[type="text"],
body.tn-shell .tn-form input[type="email"],
body.tn-shell .tn-form input[type="tel"],
body.tn-shell .tn-form input[type="password"],
body.tn-shell .tn-form select,
body.tn-shell .tn-form textarea,
.tn-form input[type="text"],
.tn-form input[type="email"],
.tn-form input[type="tel"],
.tn-form input[type="password"],
.tn-form select,
.tn-form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: var(--tn-font);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--tn-ink);
  background: var(--tn-white);
  border: 1.5px solid var(--tn-line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

body.tn-shell .tn-form select,
.tn-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23008c9f' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

body.tn-shell .tn-form textarea,
.tn-form textarea {
  min-height: 140px;
  resize: vertical;
}

body.tn-shell .tn-form input:focus,
body.tn-shell .tn-form select:focus,
body.tn-shell .tn-form textarea:focus,
.tn-form input:focus,
.tn-form select:focus,
.tn-form textarea:focus {
  outline: none;
  border-color: var(--tn-teal);
  box-shadow: 0 0 0 3px rgba(0, 140, 159, 0.18);
}

.tn-form-panel {
  background: var(--tn-cyan);
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius);
  padding: 16px 18px;
  margin: 0 0 1.25rem;
}

.tn-form-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.tn-price-list {
  list-style: none;
  /* Expanding side space so tiers sit as a centered block in the panel */
  max-width: 22rem;
  width: 100%;
  margin: 0.75rem auto 1rem;
  padding: 0.25rem 1.25rem;
  box-sizing: border-box;
}

.tn-price-list li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid rgba(0, 140, 159, 0.12);
  font-size: 0.95rem;
}

.tn-price-list li:last-child {
  border-bottom: none;
}

.tn-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--tn-ink);
}

.tn-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  accent-color: var(--tn-teal);
  cursor: pointer;
}

.tn-check a {
  font-weight: 600;
}

.tn-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 1.75rem;
}

.tn-form-note {
  font-size: 0.85rem;
  color: var(--tn-muted);
  margin: 0.75rem 0 0;
}

/* Contact / two-column content */
.tn-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
  margin: 1rem 0 2rem;
}

@media (min-width: 800px) {
  .tn-split {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.tn-map {
  display: block;
  width: 100%;
  min-height: 280px;
  height: 320px;
  border: 0;
  border-radius: var(--tn-radius);
  box-shadow: var(--tn-shadow);
}

.tn-info-block h3 {
  margin: 0 0 0.5rem;
}

.tn-info-block p {
  margin: 0 0 0.35rem;
}

.tn-info-stack {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.tn-alert {
  border-radius: var(--tn-radius);
  padding: 16px 18px;
  margin: 0 0 1.25rem;
}

.tn-alert-success {
  background: var(--tn-cyan);
  border: 1px solid rgba(0, 140, 159, 0.35);
  color: var(--tn-ink);
}

.tn-alert-error {
  background: #fff5f5;
  border: 1px solid #f0c0c0;
  color: #8a1f1f;
}

.tn-payment-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  background: var(--tn-cyan);
  border: 1px solid rgba(0, 140, 159, 0.35);
  border-radius: var(--tn-radius);
  padding: 16px 18px;
  margin: 1rem 0;
  line-height: 1.6;
}

.tn-payment-box b {
  font-family: var(--tn-font);
  color: var(--tn-teal);
}

/* --- Level test forms --- */
.tn-level-card {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

body.tn-shell .tn-level-form ol {
  margin: 0 0 1.5rem;
  padding: 0 0 0 1.25rem;
  list-style: decimal;
}

body.tn-shell .tn-level-form li {
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--tn-line);
}

body.tn-shell .tn-level-form h6,
body.tn-shell .tn-level-form h4 {
  font-family: var(--tn-font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tn-ink);
  margin: 0 0 0.65rem;
  letter-spacing: 0;
}

/* Keep custom radio labels readable inside shell */
body.tn-shell .tn-level-form .container {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--tn-ink);
  margin-bottom: 10px;
}

body.tn-shell .tn-level-form .bottomBorder {
  border-bottom: none;
}

/* German-style plain radio blocks */
body.tn-shell .tn-level-form input[type="radio"] {
  accent-color: var(--tn-teal);
  margin-right: 0.35rem;
}

.tn-level-contact {
  margin-top: 1.5rem;
}

.tn-level-result h2,
body.tn-shell .tn-level-result .testHead,
body.tn-shell h2.testHead {
  color: var(--tn-teal);
  font-size: 1.35rem;
  border-bottom: 1px solid var(--tn-line);
  padding-bottom: 0.5rem;
  margin: 0 0 1rem;
}

.tn-level-result p {
  margin: 0 0 0.85rem;
}

/* Language / test chips (level-test hub, future listings) */
.tn-lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 1.5rem 0 0;
}

a.tn-lang-chip,
.tn-lang-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid var(--tn-teal);
  background: var(--tn-white);
  color: var(--tn-teal) !important;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(0, 60, 70, 0.08);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

a.tn-lang-chip:hover,
a.tn-lang-chip:focus,
.tn-lang-chip:hover,
.tn-lang-chip:focus {
  background: var(--tn-teal) !important;
  color: var(--tn-white) !important;
  text-decoration: none !important;
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 60, 70, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  a.tn-lang-chip:hover,
  a.tn-lang-chip:focus {
    transform: none;
  }
}

/* --- Footer --- */
/* Higher specificity than bare layout.css `footer` / `li>a` so shell pages match home */
body.tn-shell .tn-footer,
.tn-footer {
  display: block;
  clear: both;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background: #0f3d44;
  color: #d0e4e8;
  padding: 40px 0 28px;
  margin: 0;
  font-family: var(--tn-font);
  font-size: 0.95rem;
  letter-spacing: 0;
  line-height: 1.55;
}

body.tn-shell .tn-footer a,
.tn-footer a,
body.tn-shell .tn-footer li > a,
.tn-footer li > a {
  color: #a8dde6;
  text-decoration: none;
  margin: 0;
  margin-right: 0;
  padding: 0;
  background: transparent;
  font-size: inherit;
}

body.tn-shell .tn-footer a:hover,
.tn-footer a:hover,
body.tn-shell .tn-footer li > a:hover,
.tn-footer li > a:hover {
  color: var(--tn-white);
  text-decoration: underline;
  background: transparent;
}

.tn-footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 28px;
  width: 100%;
  box-sizing: border-box;
}

/* Desktop: col1 left | expanding space | col2 + col3 right (align with header lang icon) */
@media (min-width: 600px) {
  .tn-footer-grid {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 28px 40px;
  }

  .tn-footer-grid > :first-child {
    flex: 0 1 auto;
    min-width: 0;
  }

  /* Expanding filler between columns 1 and 2 */
  .tn-footer-grid > :nth-child(2) {
    margin-left: auto;
  }

  .tn-footer-grid > :nth-child(2),
  .tn-footer-grid > :nth-child(3) {
    flex: 0 0 auto;
  }
}

body.tn-shell .tn-footer h4,
.tn-footer h4 {
  color: var(--tn-white);
  font-family: var(--tn-font);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  font-weight: 600;
  padding: 0;
}

.tn-footer p {
  margin: 0 0 0.75em;
  color: inherit;
}

.tn-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tn-footer li {
  margin: 0 0 8px;
  padding: 0;
}

.tn-footer-copy {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  font-size: 0.85rem;
  color: #8aadb4;
  letter-spacing: 0;
}

/* Utility: main content spacing */
.tn-main {
  min-height: 50vh;
}

/* Legacy float rows inside shell content — softer */
.tn-shell .feature-box,
.tn-shell .benefit-card,
.tn-shell .duo-box {
  border-radius: var(--tn-radius);
}
