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

:root {
  --border-width: 5px;
  --shadow: 8px 8px 0px 0px rgba(0, 0, 0, 0.2);
  --shadow-dark: 8px 8px 0px 0px rgba(255, 255, 255, 0.2);
  --radius: 0px;
  --font-mono: 'Courier New', Courier, monospace;
  --font-serif: Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --surface: #2a2a2a;
    --text: #e8e8e8;
    --muted: #999;
    --border: #fff;
    --shadow: var(--shadow-dark);
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f5;
    --surface: #fff;
    --text: #111;
    --muted: #555;
    --border: #000;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Layout ── */
.layout {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  width: 100%;
  max-width: 900px;
  align-items: flex-start;
}

.main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-col {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 680px) {
  .layout {
    flex-direction: column;
  }
  .side-col {
    width: 100%;
  }
}

/* ── Title box ── */
.title-box {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
}

.title-box h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: bold;
  line-height: 1.2;
}

.title-box p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Form card ── */
.form-card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ── Sidebar cards ── */
.card-green,
.card-yellow,
.card-red {
  border: var(--border-width) solid rgba(0, 0, 0, 0.2);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.card-green {
  background: #bbf7d0;
}
.card-yellow {
  background: #fef08a;
}
.card-red {
  background: #fecaca;
}

@media (prefers-color-scheme: dark) {
  .card-green {
    background: #166534;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-dark);
    color: #e8e8e8;
  }
  .card-yellow {
    background: #854d0e;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-dark);
    color: #e8e8e8;
  }
  .card-red {
    background: #7f1d1d;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-dark);
    color: #e8e8e8;
  }
}

.card-green h2,
.card-yellow h2,
.card-red h2 {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.card-green p,
.card-yellow p,
.card-red p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ── Fields ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.field:last-child {
  margin-bottom: 0;
}

label {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

label .optional {
  opacity: 0.5;
  margin-left: 0.4em;
}

input[type='text'],
input[type='password'],
textarea {
  background: var(--bg);
  border: var(--border-width) solid var(--border);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
  outline: none;
  transition: box-shadow 0.1s;
}

input[type='text']:focus,
input[type='password']:focus,
textarea:focus {
  box-shadow: 4px 4px 0 0 var(--border);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

/* ── File input ── */
.file-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: var(--border-width) dashed var(--border);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--font-mono);
  transition: box-shadow 0.1s;
}

.file-label:hover {
  box-shadow: 4px 4px 0 0 var(--border);
}

input[type='file'] {
  display: none;
}

#file-name {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Tags ── */
.tags-wrapper {
  position: relative;
}

#tag-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-top: none;
  z-index: 10;
  max-height: 180px;
  overflow-y: auto;
}

#tag-suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
}

#tag-suggestions button:last-child {
  border-bottom: none;
}
#tag-suggestions button:first-child {
  background: var(--border);
  color: var(--surface);
}
#tag-suggestions button:hover {
  opacity: 0.7;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #000;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
}

@media (prefers-color-scheme: dark) {
  .chip {
    background: #fff;
    color: #000;
  }
}

.chip button {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.chip button:hover {
  opacity: 1;
}

/* ── Radio group ── */
.radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.4rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  cursor: pointer;
}

input[type='radio'] {
  accent-color: var(--border);
}

/* ── Submit ── */
.btn {
  width: 100%;
  background: #000;
  color: #fff;
  border: var(--border-width) solid #000;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 1rem;
  transition:
    box-shadow 0.1s,
    opacity 0.1s;
}

.btn:hover {
  box-shadow: 4px 4px 0 0 var(--muted);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  .btn {
    background: #fff;
    color: #000;
    border-color: #fff;
  }
}

/* ── Logout ── */
.btn-logout {
  display: inline-block;
  margin-top: 0.6rem;
  background: none;
  border: 2px solid currentColor;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  opacity: 0.7;
  text-decoration: none;
}

.btn-logout:hover {
  opacity: 1;
}

/* ── Location suggestions (shared with tags layout) ── */
#location-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-top: none;
  z-index: 10;
  max-height: 180px;
  overflow-y: auto;
}

#location-suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
}

#location-suggestions button:last-child {
  border-bottom: none;
}
#location-suggestions button:first-child {
  background: var(--border);
  color: var(--surface);
}
#location-suggestions button:hover {
  opacity: 0.7;
}
