/* ---------------------------------------------------------------
   Palette
   Ocean navy page background, ivory ticket card, brass accent.
   Teal / rust are semantic only: survived vs did-not-survive.
   --------------------------------------------------------------- */
:root {
  --navy: #0b1f2e;
  --navy-soft: #16324a;
  --ivory: #f0e6d2;
  --ink: #21201c;
  --ink-muted: #5b564a;
  --brass: #b08d57;
  --brass-dark: #93713e;
  --teal: #2f6e5e;
  --teal-bg: #e4efe9;
  --rust: #b3441e;
  --rust-bg: #f4e6df;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse at top, var(--navy-soft), var(--navy) 65%);
  font-family: var(--font-body);
  color: var(--ink);
}

/* ---------------------------------------------------------------
   Ticket card
   --------------------------------------------------------------- */
.ticket {
  width: 100%;
  max-width: 440px;
  background: var(--ivory);
  border-radius: 10px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: settle 0.5s ease-out;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ticket-header {
  padding: 32px 32px 24px;
  text-align: center;
  border-bottom: 2px dashed var(--brass);
}

.ticket-hero {
  width: 180px;
  margin: 0 auto 12px;
}

.hero-svg {
  width: 100%;
  height: auto;
}

.hero-waves {
  fill: none;
  stroke: var(--brass);
  stroke-width: 2;
  opacity: 0.6;
}

.hero-hull,
.hero-body,
.hero-funnel {
  fill: var(--navy);
}

.ticket-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--ink);
}

.ticket-subtitle {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 34ch;
  margin-inline: auto;
}

/* ---------------------------------------------------------------
   Form
   --------------------------------------------------------------- */
.ticket-form {
  padding: 24px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
}

input,
select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--brass);
  padding: 6px 2px;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus,
select:focus {
  border-bottom: 2px solid var(--brass-dark);
  padding-bottom: 5px;
}

input:invalid:not(:placeholder-shown),
select:invalid {
  border-bottom-color: var(--rust);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: right 4px top 55%, right 12px top 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.submit-btn {
  margin-top: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  background: var(--brass);
  color: var(--ivory);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.submit-btn:hover {
  background: var(--brass-dark);
}

.submit-btn:active {
  transform: translateY(1px);
}

/* ---------------------------------------------------------------
   Result panel
   --------------------------------------------------------------- */
.result-panel {
  margin: 0 32px 32px;
  padding: 18px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid var(--ink-muted);
  background: #ffffff80;
  animation: settle 0.4s ease-out;
}

.result-panel.is-survived {
  border-left-color: var(--teal);
  background: var(--teal-bg);
}

.result-panel.is-not-survived {
  border-left-color: var(--rust);
  background: var(--rust-bg);
}

.result-panel.is-error {
  border-left-color: var(--ink-muted);
  background: #ffffffb3;
}

.result-panel.is-error .result-icon {
  display: none;
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.result-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--ink-muted);
}

.result-panel.is-survived .result-icon {
  color: var(--teal);
}

.result-panel.is-not-survived .result-icon {
  color: var(--rust);
}

.result-icon svg {
  width: 100%;
  height: 100%;
}

.result-headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.result-detail {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------
   Small screens
   --------------------------------------------------------------- */
@media (max-width: 420px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .ticket-header,
  .ticket-form {
    padding-left: 24px;
    padding-right: 24px;
  }
}
