/* SPDX-License-Identifier: MIT */
/* styles.css — A & S Ludwig GbR charging station UI */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

main {
  width: 100%;
  max-width: 480px;
}

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.card-header .icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.card-header h1 { font-size: 1.25rem; font-weight: 700; color: #1a1a1a; }
.card-header p  { font-size: 0.875rem; color: #666; margin-top: 0.25rem; }

.site-logo { display: block; margin: 0 auto 0.75rem auto; max-width: 100%; height: auto; }

/* ── buttons ── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  border: none; cursor: pointer; transition: all 0.15s ease;
  width: 100%; text-align: center;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: #059669; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #047857; }

.btn-danger  { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #b91c1c; }

.btn-outline { background: transparent; border: 2px solid #d1d5db; color: #374151; }
.btn-outline:hover:not(:disabled) { border-color: #9ca3af; }

.btn-link { background: none; border: none; color: #6b7280; text-decoration: underline; font-size: 0.875rem; padding: 0.5rem; }

/* ── station list ── */

.station-item {
  width: 100%; text-align: left;
  padding: 1rem; border-radius: 12px; border: 2px solid #e5e7eb;
  background: #fff; cursor: pointer; transition: all 0.15s ease;
  margin-bottom: 0.75rem;
}
.station-item:last-child { margin-bottom: 0; }
.station-item:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.station-item .label { font-weight: 600; font-size: 0.95rem; }
.station-item .sub   { font-size: 0.8rem; margin-top: 0.2rem; }

.station-available { border-color: #10b981; background: #ecfdf5; }
.station-available .label { color: #065f46; }
.station-available .sub   { color: #059669; }

.station-busy { border-color: #d1d5db; background: #f9fafb; opacity: 0.7; }
.station-busy .label { color: #6b7280; }
.station-busy .sub   { color: #9ca3af; }

.station-offline { border-color: #fca5a5; background: #fef2f2; opacity: 0.7; }
.station-offline .label { color: #991b1b; }
.station-offline .sub   { color: #dc2626; }

.station-paypal { border-color: #3b82f6; background: #eff6ff; }
.station-paypal .label { color: #1e40af; }
.station-paypal .sub   { color: #3b82f6; }

/* ── forms ── */

.form-group { margin-bottom: 0.75rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: #374151; margin-bottom: 0.25rem; }
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password] {
  width: 100%; padding: 0.625rem 0.75rem; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 0.9rem; outline: none; transition: border-color 0.15s;
}
.form-group input:focus { border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,0.1); }

.form-row { display: flex; gap: 0.5rem; }
.form-row .form-group { flex: 1; }

.checkbox-group { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.8rem; color: #6b7280; margin-top: 0.75rem; }
.checkbox-group input { margin-top: 0.15rem; }

/* ── status badges ── */

.badge {
  display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }

/* ── alerts ── */

.alert {
  padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.875rem;
  text-align: center; margin-bottom: 1rem;
}
.alert-info   { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warn   { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-error  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success{ background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }

/* ── progress bar ── */

.progress { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin: 0.5rem 0; }
.progress-bar { height: 100%; background: #059669; border-radius: 4px; transition: width 0.5s ease; }
.progress-bar.warn { background: #f59e0b; }
.progress-bar.danger { background: #dc2626; }

/* ── grid metrics ── */

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.metric { background: #f9fafb; border-radius: 10px; padding: 0.75rem; }
.metric .label { font-size: 0.75rem; color: #9ca3af; text-transform: uppercase; }
.metric .value { font-size: 1.15rem; font-weight: 700; color: #1a1a1a; margin-top: 0.2rem; }

/* ── utilities ── */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

/* ── spinner ── */

.spinner {
  width: 2rem; height: 2rem; border: 3px solid #e5e7eb;
  border-top-color: #059669; border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PayPal button style ── */

.btn-paypal {
  background: #ffc439;
  color: #003087;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 2rem;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.btn-paypal:hover:not(:disabled) {
  background: #f2bb2f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-paypal:active:not(:disabled) {
  transform: translateY(0);
}
.btn-paypal:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  display: block;
  width: 100%;
}

#paypal-button-container {
  margin: 0.5rem 0 1rem 0;
}

/* ── footer ── */

footer {
  margin-top: 1.5rem; font-size: 0.75rem; color: #9ca3af; text-align: center;
}
footer a { color: #6b7280; }

/* ── pflichtfeld markierung ── */
.pflicht { color: #dc2626; font-weight: 700; }
.optional { color: #9ca3af; font-weight: 400; font-size: 0.8rem; }

/* ── PayPal Express Button ── */
#paypal-express-btn {
  background: #0070ba;
  color: #fff;
  border: none;
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
}
#paypal-express-btn:hover:not(:disabled) {
  background: #005ea6;
}
#paypal-express-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}