:root {
  --future-blue: #2153FF;
  --midnight-blue: #062E53;
  --dark-midnight: #051E36;
  --green-yes: #16A34A;
  --red-no: #DC2626;
  --text: #1D1D1D;
  --bg: #F8F9FA;
  --white: #FFFFFF;
  --radius-tile: 25px;
  --radius-btn: 5px;

  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background:
    radial-gradient(ellipse at top, rgba(33, 83, 255, 0.08), transparent 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--midnight-blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(6, 46, 83, 0.35);
}

a:hover,
a:focus-visible {
  border-bottom-color: var(--midnight-blue);
}

/* Header --------------------------------------------------------------- */

.site-header {
  padding: 24px 24px 8px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.logo {
  display: inline-block;
  border: none;
}

.logo img {
  display: block;
  height: 48px;
  width: auto;
}

@media (max-width: 480px) {
  .logo img {
    height: 40px;
  }
}

/* Container ------------------------------------------------------------ */

.container {
  flex: 1 0 auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 24px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen {
  animation: fade-in 0.18s ease-out;
}

.screen[hidden] {
  display: none !important;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Typography ----------------------------------------------------------- */

.headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.15;
  color: var(--midnight-blue);
  margin: 16px 0 8px;
  letter-spacing: -0.01em;
}

.headline .greeting {
  font-weight: 400;
  color: var(--text);
  display: block;
  font-size: 0.55em;
  margin-bottom: 4px;
  letter-spacing: 0;
}

.headline .recipient {
  display: block;
}

.sub-headline {
  font-family: var(--font-body);
  font-size: clamp(16px, 2.4vw, 18px);
  color: var(--text);
  margin: 0 0 28px;
}

.body {
  font-size: 17px;
  margin: 16px 0;
  max-width: 56ch;
}

.signature {
  font-size: 17px;
  margin-top: 32px;
  color: var(--text);
}

/* Tiles ---------------------------------------------------------------- */

.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}

@media (min-width: 760px) {
  .tile-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

.tile {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--white);
  background: var(--midnight-blue);
  border-radius: var(--radius-tile);
  padding: 28px 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease-out, filter 0.12s ease-out, box-shadow 0.18s ease-out;
  box-shadow: 0 1px 2px rgba(6, 46, 83, 0.06);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.tile__icon {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 64px;
  height: 64px;
  opacity: 0.28;
  pointer-events: none;
}

.tile__icon path {
  fill: #FFFFFF;
}

.tile__title,
.tile__subtitle {
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .tile__icon {
    width: 52px;
    height: 52px;
    right: 14px;
    bottom: 12px;
  }
}

.tile:hover {
  filter: brightness(1.04);
  box-shadow: 0 6px 18px rgba(6, 46, 83, 0.12);
}

.tile:active {
  transform: scale(0.98);
}

.tile:focus-visible {
  outline: 3px solid var(--future-blue);
  outline-offset: 3px;
}

.tile[aria-busy="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.tile__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3.4vw, 24px);
  line-height: 1.2;
  color: var(--white);
}

.tile__subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  opacity: 0.92;
}

.tile--yes      { background: var(--green-yes); }
.tile--no       { background: var(--red-no); }
.tile--midnight { background: var(--midnight-blue); }

/* Confirmation screens ------------------------------------------------- */

.screen--confirm {
  background: var(--white);
  border-radius: var(--radius-tile);
  padding: 40px 28px;
  margin-top: 24px;
  box-shadow: 0 1px 2px rgba(6, 46, 83, 0.04);
}

.confirm__icon {
  margin-bottom: 8px;
}

.retry-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  background: var(--future-blue);
  border-radius: var(--radius-btn);
  padding: 12px 20px;
  margin-top: 16px;
  transition: filter 0.12s ease-out;
}

.retry-btn:hover { filter: brightness(1.05); }
.retry-btn:active { transform: scale(0.98); }

/* Loading overlay ------------------------------------------------------ */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 249, 250, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-overlay[data-visible="true"] {
  display: flex;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(6, 46, 83, 0.2);
  border-top-color: var(--midnight-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Back-Layer ----------------------------------------------------------- */

/* Dezente Zwischenebene: gehört zur Marke, drängt sich aber nicht auf.
   Liegt zwischen dem Tool-Inhalt und dem Pflicht-Footer. */
.back-layer {
  text-align: center;
  padding: 36px 24px 12px;
  font-size: 13px;
  font-weight: 400;
  color: rgba(29, 29, 29, 0.35);
  letter-spacing: 0.01em;
}

.back-layer a {
  color: inherit;
  border-bottom: 0;
  font-weight: 600;
}

.back-layer a:hover,
.back-layer a:focus-visible {
  color: var(--midnight-blue);
}

/* Footer --------------------------------------------------------------- */

.site-footer {
  padding: 20px 24px 28px;
  text-align: center;
  font-size: 13px;
  color: rgba(29, 29, 29, 0.6);
}

.site-footer a {
  color: inherit;
  border-bottom: 0;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--midnight-blue);
  text-decoration: underline;
}

.site-footer .dot {
  margin: 0 8px;
}

/* Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .screen,
  .tile,
  .retry-btn {
    animation: none;
    transition: none;
  }
  .spinner {
    animation-duration: 1.5s;
  }
}
