:root {
  --accent: #ffbf52;
  --accent-strong: #001275;
  --accent-bright: #0456e7;
  --accent-deep: #001275;
  --ink: #090d1f;
  --muted: #596073;
  --surface: #ffffff;
  --surface-soft: #f7f8fc;
  --line: #d9deed;
  --danger: #9f1d1d;
  --danger-bg: #fff1f1;
  --success: #1d651d;
  --success-bg: #eef9ec;
  --shadow: 0 24px 70px rgba(0, 18, 117, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 42%),
    repeating-linear-gradient(135deg, rgba(0, 18, 117, 0.035) 0 1px, transparent 1px 26px),
    linear-gradient(145deg, #fbfbff 0%, #f1f4fb 54%, #fafafa 100%);
}

a {
  color: var(--accent-bright);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-strong);
}

.container {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  place-items: center;
  padding: clamp(24px, 6vw, 64px);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 520px);
  gap: 16px;
  align-items: start;
  justify-content: center;
  width: 100%;
  max-width: 520px;
}

.layout > * {
  min-width: 0;
}

.card {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: clamp(28px, 5vw, 42px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(217, 222, 237, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card::before {
  display: block;
  width: min(220px, 72%);
  height: 0px;
  margin: 0 0 30px;
  content: "";
  background-image: url("./img/meraki-logo.png");
  background-position: left center;
  background-repeat: no-repeat;
  background-size: contain;
}

.card::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--accent-bright), var(--accent-strong));
}

h1 {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: clamp(2rem, 5vw, 2.7rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
}

.muted {
  max-width: 32rem;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

form {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: block;
  margin: 0;
  color: #121939;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.35;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fbfbff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input[type="text"]:hover,
input[type="email"]:hover {
  border-color: #b9c1dc;
}

input[type="text"]:focus,
input[type="email"]:focus {
  background: #ffffff;
  border-color: var(--accent-bright);
  outline: 3px solid rgba(4, 86, 231, 0.18);
  box-shadow: 0 0 0 1px rgba(0, 18, 117, 0.12);
}

.checkbox {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  color: #3b4154;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.55;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent-bright);
}

.checkbox span {
  min-width: 0;
  overflow-wrap: break-word;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  color: #ffffff;
  background: var(--accent-strong);
  border: 0;
  border-radius: 6px;
  box-shadow: 0 13px 24px rgba(0, 18, 117, 0.24);
  cursor: pointer;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

button:hover {
  background: var(--accent-bright);
  box-shadow: 0 16px 30px rgba(4, 86, 231, 0.24);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid rgba(255, 191, 82, 0.55);
  outline-offset: 3px;
}

button:disabled {
  box-shadow: none;
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.status {
  margin: 0 0 20px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.status.success {
  color: var(--success);
  background: var(--success-bg);
  border-color: #b8e2b0;
}

.status.error {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f2c6c6;
}

.hidden {
  display: none !important;
}

.debug {
  margin-top: 24px;
  padding-top: 16px;
  color: #4b5266;
  border-top: 1px solid var(--line);
}

.debug summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

pre {
  max-height: 180px;
  margin: 12px 0 0;
  overflow: auto;
  padding: 14px;
  color: #e8ecff;
  background: #090d1f;
  border-radius: 6px;
  font-size: 0.76rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.terms-panel {
  width: 100%;
  margin-top: 0;
  padding: 22px;
  color: #edf0ff;
  background: var(--accent-deep);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(0, 18, 117, 0.16);
  text-align: center;
}

.terms-panel p {
  margin: 0;
}

.terms-panel small {
  display: block;
  font-size: 0.88rem;
  line-height: 1.55;
}

.terms-panel a {
  color: #ffffff;
}

.terms-panel a:hover {
  color: var(--accent);
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: minmax(0, 520px);
    max-width: 520px;
  }
}

@media (max-width: 560px) {
  html,
  body {
    overflow-x: hidden;
  }

  .container {
    align-items: start;
    padding: 18px;
  }

  .layout {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
  }

  .card {
    width: 100%;
    padding: 24px;
  }

  .card::before {
    height: 64px;
    margin-bottom: 24px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  .terms-panel {
    width: 100%;
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
