:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #03161f;
  color: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #072431 0%, #03161f 100%);
}

.page {
  max-width: 430px;
  margin: 0 auto;
  padding: 18px;
}

.page-login,
.screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

header {
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: 0.02em;
}

h2 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

p {
  margin: 0;
  line-height: 1.6;
}

.card,
.summary-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 18px;
}

label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.label-full {
  width: 100%;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  padding: 14px 16px;
  margin-top: 6px;
  font-size: 1rem;
}

select {
  background: #0d2535;
}

select option {
  background-color: #0d2535;
  color: #f8fafc;
}

input::placeholder,
textarea::placeholder {
  color: rgba(248, 250, 252, 0.5);
}

.autocomplete-wrapper {
  position: relative;
  margin-top: 6px;
}

.autocomplete-wrapper input {
  margin-top: 0;
}

.suggestions-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0d2535;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  list-style: none;
  margin: 0;
  padding: 6px;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  color: #f8fafc;
  font-size: 1rem;
  border-radius: 10px;
}

.suggestion-item:hover,
.suggestion-item:active {
  background: rgba(14, 165, 233, 0.22);
}

button {
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  padding: 14px 18px;
  cursor: pointer;
}

button.primary {
  background: #0ea5e9;
  color: #03161f;
  font-weight: 700;
}

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

button.small-button {
  background: transparent;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 14px;
  font-size: 0.95rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint,
.small {
  color: rgba(248, 250, 252, 0.68);
  font-size: 0.92rem;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(3, 22, 31, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.network-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-area {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.step-desc {
  color: rgba(248, 250, 252, 0.74);
  margin-top: 0.4rem;
}

.summary-card p {
  margin: 12px 0;
}

.hidden {
  display: none !important;
}

.visible {
  display: block;
}

@media (max-width: 420px) {
  .page {
    padding: 14px;
  }

  button,
  input,
  select,
  textarea {
    font-size: 1rem;
  }
}

/* ---- Progress bar ---- */
.progress-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.progress-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: transform 0.1s;
}

.progress-dot:active { transform: scale(0.85); }

.dot-empty   { background: transparent; border-color: rgba(248,250,252,0.25); }
.dot-done    { background: #22c55e; border-color: #22c55e; }
.dot-na      { background: #6b7280; border-color: #6b7280; }
.dot-pending { background: #f59e0b; border-color: #f59e0b; }
.dot-active  { outline: 2px solid #0ea5e9; outline-offset: 2px; }

/* ---- Next button green when step has photos ---- */
button.btn-green {
  background: #22c55e;
  color: #03161f;
}

/* ---- Pending list in summary screen ---- */
.pending-list-container {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 16px;
  padding: 10px;
  margin: 4px 0;
}

.pending-item {
  padding: 10px 12px;
  cursor: pointer;
  color: #f59e0b;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pending-item:hover,
.pending-item:active { background: rgba(245,158,11,0.15); }

.summary-stat { margin: 6px 0; font-size: 0.95rem; }

.progress-step { font-size: 0.9rem; padding: 3px 0; transition: opacity 0.3s, color 0.3s; }
.progress-step.dim    { opacity: 0.35; }
.progress-step.active { color: #0ea5e9; font-weight: 600; }
.progress-step.done   { color: #22c55e; opacity: 1; }
