* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.container {
  width: 100%;
  max-width: 500px;
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  margin: auto;
}

/* ── Header ──────────────────────────────────────────────────────── */

.header {
  text-align: center;
  margin-bottom: 28px;
}

.header h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
}

.header p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* ── Mode toggle (segmented control) ─────────────────────────────── */

.mode-toggle {
  display: flex;
  background: #f0f8ff;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid #d0eaff;
  gap: 4px;
}

.mode-option {
  flex: 1;
  cursor: pointer;
}

.mode-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mode-label {
  display: block;
  text-align: center;
  padding: 10px 6px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.mode-option input[type="radio"]:checked + .mode-label {
  background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.35);
}

/* ── Field groups ────────────────────────────────────────────────── */

.field-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
}

.required-mark {
  color: #e74c3c;
  font-size: 14px;
}

.optional-mark {
  font-weight: 400;
  font-size: 12px;
  color: #aaa;
}

/* ── Inputs, selects, textarea ───────────────────────────────────── */

select,
input[type="date"],
input[type="time"],
input[type="number"],
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
  font-family: inherit;
  color: #1a1a1a;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234FACFE' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

select:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="number"]:hover,
textarea:hover {
  border-color: #4FACFE;
  background: white;
}

select:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: #4FACFE;
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

select.field-invalid,
input.field-invalid,
textarea.field-invalid {
  border-color: #e74c3c;
  background: #fff8f8;
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ── Input with unit label (length / depth) ──────────────────────── */

.input-unit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-unit-wrap input {
  flex: 1;
}

.unit-label {
  font-size: 14px;
  font-weight: 600;
  color: #888;
  white-space: nowrap;
  min-width: 16px;
}

/* ── Validation errors ───────────────────────────────────────────── */

.field-error {
  margin: 6px 0 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #e74c3c;
}

.form-error {
  margin: 4px 0 16px 0;
  padding: 12px 14px;
  background: #fff0f0;
  border: 1px solid #fcc;
  border-left: 4px solid #e74c3c;
  border-radius: 8px;
  font-size: 14px;
  color: #c0392b;
}

/* ── Success banner ──────────────────────────────────────────────── */

.success-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #e8f8ef;
  border: 1px solid #a8ddb8;
  border-left: 4px solid #27ae60;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1e8449;
  margin-bottom: 20px;
}

.success-banner a {
  color: #1e8449;
  font-weight: 700;
}

/* ── Action buttons ──────────────────────────────────────────────── */

.actions {
  margin-top: 8px;
}

.primary-button {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79, 172, 254, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}

.primary-button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.2);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.secondary-button {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid #4FACFE;
  border-radius: 8px;
  background: white;
  color: #4FACFE;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  text-align: center;
  font-family: inherit;
}

.secondary-button:active {
  transform: scale(0.98);
  background: #f0f8ff;
}

.secondary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.back-button {
  display: block;
  width: 100%;
  padding: 14px 12px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  background: #f0f8ff;
  color: #4FACFE;
  text-decoration: none;
  text-align: center;
  border: 2px solid #d0eaff;
  transition: background 0.2s, transform 0.2s;
}

.back-button:active {
  transform: scale(0.98);
  background: #e0f0ff;
}

/* ── Loading indicator ───────────────────────────────────────────── */

.loading-indicator {
  text-align: center;
  padding: 32px 20px;
  background: #f0f8ff;
  border-radius: 8px;
  border: 2px solid #4FACFE;
  margin-bottom: 16px;
}

.fishing-animation {
  font-size: 48px;
  margin-bottom: 12px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bobber {
  display: inline-block;
  margin-left: 8px;
  font-size: 24px;
  animation: bobbing 2s ease-in-out infinite;
}

@keyframes bobbing {
  0%, 100% { transform: translateY(0px);   opacity: 0.6; }
  50%       { transform: translateY(-12px); opacity: 1;   }
}

.loading-indicator p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #4FACFE;
}

/* ── Lookup error card ───────────────────────────────────────────── */

.error-card {
  text-align: center;
  padding: 24px 16px;
  background: #fff8f8;
  border-radius: 8px;
  border: 2px solid #fcc;
  margin-bottom: 16px;
}

.error-card .error-icon {
  font-size: 40px;
  margin: 0 0 12px 0;
}

.error-card p {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

/* ── Utility ─────────────────────────────────────────────────────── */

.hidden {
  display: none !important;
}
