:root {
  color-scheme: light;
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface-muted: #f6f8fa;
  --text: #17212b;
  --text-soft: rgba(23, 33, 43, 0.84);
  --muted: #687486;
  --line: #dfe5ec;
  --primary: #176b87;
  --primary-dark: #104e63;
  --accent: #c85f37;
  --accent-soft: #fff0e9;
  --success: #16734a;
  --shadow: 0 26px 70px rgba(25, 37, 52, 0.16);
  --soft-shadow: 0 14px 35px rgba(25, 37, 52, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(23, 107, 135, 0.32), transparent 25%),
    radial-gradient(circle at 86% 12%, rgba(200, 95, 55, 0.28), transparent 24%),
    radial-gradient(circle at 78% 82%, rgba(85, 126, 78, 0.24), transparent 27%),
    radial-gradient(circle at 18% 88%, rgba(94, 77, 160, 0.2), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(244, 241, 236, 0.62)),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.28), transparent 42%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.16) 0,
      rgba(255, 255, 255, 0.16) 1px,
      transparent 1px,
      transparent 18px
    );
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--primary), #20849f);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(23, 107, 135, 0.24);
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

button:hover {
  background: linear-gradient(135deg, #104e63, #176b87);
  box-shadow: 0 18px 34px rgba(23, 107, 135, 0.3);
  transform: translateY(-1px);
}

button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.98);
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--primary), #20849f);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(23, 107, 135, 0.22);
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 24px rgba(23, 107, 135, 0.28);
  transform: translateY(-1px);
}

button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  background: var(--surface-muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(209, 218, 224, 0.95);
  border-radius: 16px;
  padding: 15px 16px;
  color: var(--text);
  background: rgba(248, 250, 252, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(23, 107, 135, 0.35);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(23, 107, 135, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: rgba(80, 98, 117, 0.55);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 52%,
    calc(100% - 13px) 52%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(21, 111, 122, 0.16);
}

input[readonly] {
  background: var(--surface-muted);
  color: var(--muted);
}

input:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

label {
  display: grid;
  gap: 8px;
  color: rgba(44, 55, 68, 0.92);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

label .label-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

label .required-star {
  color: var(--accent);
  font-weight: 700;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.category-tab {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(23, 107, 135, 0.15);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.category-tab:hover,
.category-tab.active {
  background: rgba(23, 107, 135, 0.12);
  border-color: rgba(23, 107, 135, 0.25);
}

.category-tab.active {
  color: var(--primary-dark);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.auth-panel,
.details-panel {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-panel::before,
.details-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(23, 107, 135, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), transparent 24%);
}

.auth-panel {
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: center;
  justify-items: stretch;
  grid-template-columns: minmax(0, 1.4fr) 420px;
  gap: clamp(32px, 4vw, 58px);
  padding: clamp(36px, 6vw, 72px);
  width: min(1180px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(217, 225, 234, 0.9);
  box-shadow: 0 35px 120px rgba(23, 33, 43, 0.12);
  border-radius: 30px;
}

.brand-block {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  max-width: 760px;
  font-size: clamp(3rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-weight: 800;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3.6vw, 2.2rem);
  font-weight: 700;
}

h3 {
  margin-bottom: 16px;
  font-weight: 700;
}

.intro {
  max-width: 560px;
  color: #4e5f73;
  font-size: 1.05rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}


.auth-stack {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  gap: 22px;
  align-items: start;
}

.form-card {
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(221, 229, 236, 0.9);
  border-radius: 26px;
  box-shadow: 0 28px 80px rgba(23, 33, 43, 0.08);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.form-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 34px 96px rgba(23, 33, 43, 0.12);
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.phone-prefix-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.phone-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 52px;
  padding: 0 12px;
  border: 1px solid rgba(209, 218, 224, 0.95);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.98);
  color: var(--text);
  font-weight: 700;
}

.phone-prefix-field input {
  min-height: 52px;
}

.help-text,
.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.details-panel {
  position: relative;
  z-index: 0;
  padding: clamp(20px, 4vw, 40px);
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0 26px;
  border-bottom: 1px solid var(--line);
}

.details-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 26px;
  margin: 28px 0;
  padding: 28px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(223, 229, 236, 0.92);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(25, 37, 52, 0.12);
}

.entries-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 229, 236, 0.96);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(23, 33, 43, 0.08);
}

.submission-confirmation {
  display: grid;
  gap: 14px;
  padding: 26px;
  background: rgba(246, 250, 254, 0.95);
  border: 1px solid rgba(199, 217, 235, 0.95);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(23, 33, 43, 0.08);
}

.submission-card h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.submission-card p {
  margin: 0;
  color: rgba(23, 33, 43, 0.82);
  font-size: 0.98rem;
  line-height: 1.75;
}

.entries-topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.entries-grid {
  display: grid;
  gap: 18px;
}

.entry-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.98);
  border: 1px solid rgba(209, 218, 224, 0.95);
}

.entry-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) auto;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text);
}

.entry-label {
  font-weight: 700;
  color: rgba(23, 33, 43, 0.74);
}

.entry-value {
  color: rgba(23, 33, 43, 0.9);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.entry-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(23, 107, 135, 0.12);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.error {
  color: var(--danger);
}

.details-form::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(23, 107, 135, 0.12), rgba(200, 95, 55, 0.1));
  z-index: -1;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.section-heading span {
  width: 10px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.section-heading p {
  margin: 0;
  color: rgba(23, 33, 43, 0.92);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.section-heading span {
  box-shadow: 0 12px 28px rgba(23, 107, 135, 0.18);
}

.form-section {
  margin-bottom: 34px;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(23, 107, 135, 0.12), transparent 22%),
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(23, 107, 135, 0.16);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(23, 107, 135, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.form-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(23, 107, 135, 0.14);
}

.form-section + .form-section {
  margin-top: 20px;
}

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

.language-adder,
.adder-control,
.pet-adder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.selected-languages,
.selected-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.language-chip,
.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(23, 107, 135, 0.2);
  border-radius: 8px;
  background: rgba(23, 107, 135, 0.08);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.language-chip button,
.selected-chip button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(23, 107, 135, 0.18);
  background: var(--surface);
  box-shadow: none;
  color: var(--muted);
  font-size: 0.78rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hidden {
  display: none;
}

.status.success {
  color: var(--success);
  font-weight: 700;
}

@media (max-width: 980px) {
  .app-shell {
    width: min(100% - 22px, 1120px);
    padding: 18px 0;
  }

  .auth-panel {
    min-height: calc(100vh - 36px);
    grid-template-columns: 1fr;
    align-content: start;
    gap: 24px;
    padding: 28px 20px;
  }

  .auth-stack {
    gap: 22px;
  }

  .form-card {
    padding: 28px;
  }

  .inline-field,
  .language-adder,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .inline-field button {
    width: 100%;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .details-form {
    padding: 18px;
  }

  .form-actions button {
    width: 100%;
  }
}
