/* ── Reset & Base ── */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1f2937;
  background: #f8fafc;
}

body {
  padding: 0 0 3rem;
}

/* ── Links ── */
a {
  color: #f59e0b;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
a.btn:hover {
  text-decoration: none;
}
.btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn-primary {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}
.btn-primary:hover {
  background: #d97706;
  border-color: #d97706;
}
.btn-danger {
  border-color: #fca5a5;
  color: #dc2626;
}
.btn-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
}
.action-icon {
  margin-right: 5px;
  flex-shrink: 0;
}

/* ── Forms ── */
input, select, textarea {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
input.input-error, select.input-error, textarea.input-error, .input-error {
  border-color: #dc2626 !important;
}
input.input-error:focus, select.input-error:focus, textarea.input-error:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.15) !important;
}
input[type="number"] {
  width: 100%;
  -moz-appearance: textfield;
}
input[type="date"], input[type="time"] {
  width: 100%;
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.alert button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Cards ── */
.login-card {
  background: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  padding: 19px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
}
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  position: relative;
}
.card-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}
.card-meta {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

/* ── Grid (minimal, replacing Bootstrap's row/span) ── */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}
.row > [class*="span"] {
  padding: 0 10px;
  box-sizing: border-box;
}
.span1  { flex: 0 0 8.33%;  }
.span2  { flex: 0 0 16.66%; }
.span3  { flex: 0 0 25%;    }
.span4  { flex: 0 0 33.33%; }
.span5  { flex: 0 0 41.66%; }
.span6  { flex: 0 0 50%;    }
.offset3 { margin-left: 25%; }
.span7  { flex: 0 0 58.33%; }
.span8  { flex: 0 0 66.66%; }
.span9  { flex: 0 0 75%;    }
.span10 { flex: 0 0 83.33%; }
.span11 { flex: 0 0 91.66%; }
.span12 { flex: 0 0 100%;   }

/* ── Utility ── */
.muted { color: #9ca3af; }
.text-info { color: #3b82f6; }
.input-block-level { display: block; width: 100%; box-sizing: border-box; }

/* ── Form card ── */
.form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.page-header {
  text-align: center;
  padding: 2rem 0 1rem;
}
.page-header img {
  max-width: 200px;
  height: auto;
}
.page-header-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: .75rem;
  font-size: 13px;
}

/* ── Toggle switch ── */
.toggle-group {
  display: inline-flex;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
}
.toggle-group button {
  padding: 5px 12px;
  font-size: 12px;
  border: none;
  border-right: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
}
.toggle-group button:last-child {
  border-right: none;
}
.toggle-group button.active {
  background: #f59e0b;
  color: #fff;
}

/* ── Form row ── */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.form-row > * {
  flex: 1;
  min-width: 80px;
}
.form-row > .flex-2 {
  flex: 2;
}
.form-row > .flex-3 {
  flex: 3;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 4px;
}

.form-help {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* ── Meteogram container ── */
.meteogram-wrap {
  margin-top: 12px;
  background: #fafbfc;
  border-radius: 8px;
  padding: 10px;
}

/* ── Loading ── */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid #e5e7eb;
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Add event button ── */
.add-event-bar {
  text-align: center;
  padding: 2rem 0;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: 13px;
  color: #9ca3af;
}

/* ── Example rotation (login screen) ── */
.example {
  display: inline-block;
  transition: opacity .3s ease;
  color: #f59e0b;
  font-weight: 600;
}
.example-visible {
  opacity: 1;
}
.example-hidden {
  opacity: 0;
}

/* ── Login ── */
.login-header {
  text-align: center;
  padding: 3rem 0;
}
.login-logo {
  max-width: 200px;
  margin-bottom: 1rem;
}
.login-subtitle {
  font-size: 1.2rem;
  font-weight: bold;
  color: #78716c;
}
.login-handle-input {
  padding: 7px 9px;
  font-size: 18px;
  margin-bottom: 12px;
}

/* ── Loading ── */
.loading-view {
  text-align: center;
  padding: 4rem 0;
}

/* ── Shared View ── */
.shared-container {
  padding-top: 2rem;
}
.shared-header {
  text-align: center;
  margin-bottom: 1rem;
}
.shared-logo {
  max-width: 200px;
}
.shared-not-found {
  padding-top: 4rem;
  text-align: center;
}

/* ── Event Form Elements ── */
.form-label-spaced {
  margin-top: 12px;
}
.geocoding-error {
  color: red;
  margin-top: 4px;
  margin-bottom: 4px;
}
.form-row-spaced {
  margin-top: 12px;
}
.forecast-hours-setting {
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 14px;
}
.input-hours {
  display: inline-block;
  width: 60px;
  margin: 0 4px;
  text-align: center;
}
.form-actions-wrap {
  margin-top: 12px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.form-validation-error {
  color: #dc2626;
  font-size: 13px;
}
.map-container {
  position: relative;
  width: 100%;
  height: 340px;
  margin-top: 8px;
  border-radius: 6px;
  overflow: hidden;
}
.map-iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.map-placeholder {
  height: 340px;
  margin-top: 8px;
  border-radius: 6px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Footer ── */
.footer-heart {
  color: #ec4899;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .card-actions {
    position: static;
    margin-top: 8px;
  }
  .form-row {
    flex-direction: column;
  }
}
