:root {
  --primary: #009FE2;
  --primary-hover: #0076A8;
  --primary-tint: #E8F8FF;
  --primary-tint-strong: #D7F2FF;
  --dark: #2C2C2B;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #2C2C2B;
  --muted: #6b7280;
  --border: #e5e7eb;
  --error: #dc2626;
  --success: #059669;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: "Fira Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

body { padding: 0; }

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* iOS / Android safe areas */
@supports (padding: env(safe-area-inset-top)) {
  .screen {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

.card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.04);
  padding: 22px;
  margin-top: 12px;
}

#loginScreen.screen { justify-content: center; }
#loginScreen .card { margin-top: 0; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 0;
}

.title {
  color: var(--dark);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
  margin-bottom: 18px;
}

.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.label .optional {
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  opacity: 0.7;
}

.input {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: inherit;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,159,226,.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn--secondary {
  background: var(--primary-tint);
  border-color: var(--primary-tint-strong);
  color: var(--primary-hover);
  flex: 1;
  font-size: 14px;
}
.btn--secondary:hover {
  background: var(--primary-tint-strong);
  border-color: var(--primary);
}

.btn--full { width: 100%; }

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover { background: var(--primary-tint); color: var(--primary); }

.chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.chip {
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(0.97); }
.chip.is-active {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary-hover);
}
.chip-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 4px;
  line-height: 1;
}

.photo-buttons {
  display: flex;
  gap: 8px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--border);
}
.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.status {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}
.status.is-info    { background: var(--primary-tint); color: var(--primary-hover); border: 1px solid var(--primary-tint-strong); }
.status.is-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.status.is-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

.error {
  color: var(--error);
  font-size: 13px;
  margin-top: 12px;
}

[hidden] { display: none !important; }
