:root {
  --ink: #0c0e0d;
  --muted: #5c5c5c;
  --line: #dfdfdf;
  --soft-line: #ebebeb;
  --paper: #ffffff;
  --blossom: #fec83a;
  --blossom-soft: #fffbef;
  --surface: #fcfcfc;
  --error: #9f2424;
  --nav-muted: #7a7a7a;
  --nav-active: #323432;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.48;
}

a { color: inherit; }

.page,
#navigation-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

#navigation-container header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: auto;
  padding: 22px 0 14px;
  border-bottom: 1px solid var(--soft-line);
}

#navigation-container .logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

#navigation-container nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

#navigation-container nav a {
  margin: 0;
  color: var(--nav-muted);
  font-size: 0.94rem;
  font-weight: 550;
  text-decoration: none;
}

#navigation-container nav a:hover,
#navigation-container nav a.active {
  color: var(--nav-active);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.button,
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.66rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink) !important;
  font: inherit;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#navigation-container .cta-button:hover {
  background: var(--surface);
  border-color: #b5b5b5;
  transform: translateY(-1px);
}

.button.primary {
  width: 100%;
  min-height: 48px;
  background: var(--blossom);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.hero {
  padding: clamp(52px, 7vw, 86px) 0 30px;
  text-align: center;
}

h1,
h2,
p { margin-top: 0; }

h1 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4.4vw, 4rem);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.06;
}

.hero p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
}

.auth-shell {
  width: min(100%, 650px);
  margin: 0 auto 80px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blossom);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 16px 42px rgba(12, 14, 13, 0.08);
}

.auth-shell.compact { width: min(100%, 520px); }

.auth-shell h2 {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.auth-intro {
  margin-bottom: 26px;
  color: var(--muted);
}

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

.field { margin-bottom: 20px; }

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
.country-code-button:focus {
  outline: 3px solid rgba(254, 200, 58, 0.32);
  border-color: #9f7b17;
}

input.field-invalid,
select.field-invalid,
button.field-invalid {
  border: 2px solid #b42318;
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.14);
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--surface);
  color: var(--ink);
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(254, 200, 58, 0.42);
  color: var(--ink);
}

.password-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.password-toggle[aria-pressed="false"] .password-toggle-slash {
  display: none;
}

.country-code-picker { position: relative; }

.country-code-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.country-code-flag,
.country-code-option img {
  flex: 0 0 auto;
  width: 24px;
  height: 18px;
  border: 1px solid rgba(12, 14, 13, 0.12);
  border-radius: 2px;
  object-fit: cover;
}

.country-code-label,
.country-code-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-code-label { text-align: left; }
.country-code-chevron { margin-left: auto; color: var(--muted); }

.country-code-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  left: 0;
  width: min(360px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 18px 50px rgba(12, 14, 13, 0.16);
}

.country-code-menu input {
  min-height: 42px;
  margin-bottom: 8px;
}

.country-code-options {
  max-height: 260px;
  overflow-y: auto;
}

.country-code-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.country-code-option:hover,
.country-code-option:focus {
  outline: none;
  background: var(--blossom-soft);
}

.country-code-option[aria-selected="true"] { font-weight: 700; }
.country-code-option-dial { color: var(--muted); }

.auth-status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
}

.auth-status.error { color: var(--error); }

.privacy-note,
.auth-switch {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.auth-switch { font-size: 0.94rem; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 34px;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p { margin: 0; }
[hidden] { display: none !important; }

.success-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 14, 13, 0.28);
  backdrop-filter: blur(5px);
}

.success-dialog {
  width: min(100%, 420px);
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blossom);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 18px 60px rgba(12, 14, 13, 0.2);
  text-align: center;
}

.success-dialog h2 { margin-bottom: 24px; }
.success-dialog .button { min-width: 120px; }

@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .hero { padding-top: 42px; }
  .auth-shell { margin-bottom: 50px; }
  .footer { flex-direction: column; }
}
