* {
  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;
}

/* ── 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;
}

.field-hint {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: #999;
}

/* ── Field warning (login emails, etc.) ──────────────────────────── */

.field-warning {
  margin: 8px 0 0 0;
  padding: 10px 12px;
  background: #fff8e6;
  border: 1px solid #f5dfa0;
  border-left: 4px solid #d98c00;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #8a6200;
}

/* ── Field info (aliases, etc.) ───────────────────────────────────── */

.field-info {
  margin: 8px 0 0 0;
  padding: 10px 12px;
  background: #f0f8ff;
  border: 1px solid #d0eaff;
  border-left: 4px solid #4FACFE;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #2b6690;
}

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

input[type="text"],
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;
}

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

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

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

/* ── Status pills ──────────────────────────────────────────────────── */

.status-pills {
  display: flex;
  gap: 8px;
}

.status-pill {
  flex: 1;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
  color: #666;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  font-family: inherit;
}

.status-pill:hover {
  border-color: #4FACFE;
}

.status-pill.selected {
  background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
  border-color: transparent;
  color: white;
}

/* ── 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;
}

/* ── 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;
}

.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;
}

/* ── 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;
}

/* ── Tag input (Groups field) ────────────────────────────────────── */

.tag-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
  cursor: text;
}

.tag-input-wrapper:hover {
  border-color: #4FACFE;
  background: white;
}

.tag-input-wrapper:focus-within {
  border-color: #4FACFE;
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 12px;
  background: #f0f8ff;
  border: 1px solid #d0eaff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #2a7fd4;
  white-space: nowrap;
}

.tag-pill-remove {
  background: none;
  border: none;
  color: #7bb8e8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.tag-pill-remove:hover {
  color: #c0392b;
}

.tag-input-field {
  flex: 1;
  min-width: 100px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a1a;
  padding: 4px 2px;
}

.tag-suggestions {
  margin-top: 4px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  max-height: 170px;
  overflow-y: auto;
}

.tag-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  padding: 9px 14px;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
}

.tag-suggestion:hover {
  background: #f0f8ff;
}

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

.hidden {
  display: none !important;
}
