/* ══════════════════════════════════════════
   LOGIN / REGISTER STYLES — DEMONS RACING
   ══════════════════════════════════════════ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #070e1d;
  color: #dce2f7;
  font-family: 'Inter', system-ui, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(185, 28, 28, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(185, 28, 28, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(185, 28, 28, 0.04) 0%, transparent 40%);
  background-color: #070e1d;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card {
  background: rgba(12, 19, 34, 0.95);
  border: 1px solid rgba(91, 64, 59, 0.25);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(185, 28, 28, 0.06);
}

.logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 0 25px rgba(185, 28, 28, 0.3);
}

.logo-icon span {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.logo h1 {
  margin: 0;
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: #dce2f7;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.logo p {
  margin: 0.3rem 0 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #5b6380;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: #a0a8c0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #5b6380;
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.6rem;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(91, 64, 59, 0.2);
  border-radius: 12px;
  color: #dce2f7;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.25s;
}

.input-wrapper input:focus {
  outline: none;
  background: rgba(17, 24, 39, 0.9);
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
  color: #b91c1c;
}

.input-wrapper input::placeholder {
  color: #5b6380;
  font-size: 0.85rem;
}

.submit-btn {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(185, 28, 28, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  color: #fca5a5;
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: none;
  text-align: center;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.back-link {
  text-align: center;
  margin-top: 1.2rem;
}

.back-link a {
  color: #5b6380;
  text-decoration: none;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  display: inline-block;
  padding: 0.4rem 0.8rem;
}

.back-link a:hover {
  color: #b91c1c;
}

.loading {
  display: none;
  text-align: center;
  padding: 0.8rem;
  color: #b91c1c;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── DASHBOARD LAYOUT ─── */
.dash-wrapper {
  display: flex;
  max-width: 1100px;
  margin: 80px auto 2rem;
  padding: 0 1.5rem;
  gap: 1.5rem;
  min-height: calc(100vh - 150px);
}

.dash-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: rgba(12,19,34,0.95);
  border: 1px solid rgba(91,64,59,0.2);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: sticky;
  top: 80px;
  align-self: flex-start;
}

.dash-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg,#b91c1c,#991b1b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto;
  box-shadow: 0 0 20px rgba(185,28,28,0.3);
}

.dash-sidebar h3 {
  text-align: center;
  font-size: 0.9rem;
  color: #dce2f7;
  margin: 0;
}

.dash-sidebar p {
  text-align: center;
  font-size: 0.7rem;
  color: #5b6380;
  margin: 0;
  word-break: break-all;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.5rem;
}

.dash-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #5b6380;
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.dash-nav-btn:hover { background: rgba(185,28,28,0.08); color: #a0a8c0; }

.dash-nav-btn.active {
  background: rgba(185,28,28,0.12);
  color: #b91c1c;
}

.dash-nav-btn .material-symbols-outlined {
  font-size: 1.1rem;
}

.dash-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(91,64,59,0.2);
  background: transparent;
  color: #5b6380;
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

.dash-logout:hover { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.05); }

/* Content */
.dash-content { flex: 1; min-width: 0; }

.dash-panel { display: none; }
.dash-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.dash-card {
  background: rgba(12,19,34,0.95);
  border: 1px solid rgba(91,64,59,0.2);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.dash-heading {
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.7rem;
  color: #b91c1c;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(91,64,59,0.2);
}

.dash-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dash-heading-row .dash-heading { border-bottom: none; margin-bottom: 0.5rem; padding-bottom: 0; }

.user-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.info-item {
  background: rgba(17,24,39,0.5);
  border: 1px solid rgba(91,64,59,0.15);
  border-radius: 10px;
  padding: 0.8rem;
}
.info-item .info-label {
  display: block;
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.6rem;
  color: #5b6380;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.info-item .info-value {
  font-size: 0.85rem;
  color: #dce2f7;
}
.info-item .info-value em { color: #5b6380; font-style: normal; font-size: 0.75rem; }

/* Form */
.profile-form { display: flex; flex-direction: column; gap: 0.8rem; }
.dash-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.dash-field { display: flex; flex-direction: column; gap: 0.3rem; }
.dash-field label {
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.62rem;
  color: #5b6380;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dash-field input, .dash-field select, .dash-field textarea {
  padding: 0.65rem 0.8rem;
  background: rgba(17,24,39,0.7);
  border: 1px solid rgba(91,64,59,0.2);
  border-radius: 10px;
  color: #dce2f7;
  font-size: 0.85rem;
  font-family: 'Inter',sans-serif;
  transition: all 0.2s;
}
.dash-field input:focus, .dash-field select:focus, .dash-field textarea:focus {
  outline: none; border-color: #b91c1c; box-shadow: 0 0 0 3px rgba(185,28,28,0.08);
}
.dash-field textarea { resize: vertical; min-height: 50px; }

.dash-btn {
  padding: 0.7rem 1.4rem;
  background: linear-gradient(135deg,#b91c1c,#991b1b);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.dash-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(185,28,28,0.35); }
.dash-btn.sm { padding: 0.45rem 0.8rem; font-size: 0.6rem; }
.dash-btn.ghost { background: transparent; border: 1px solid rgba(91,64,59,0.2); color: #a0a8c0; }
.dash-btn.ghost:hover { border-color: #b91c1c; color: #b91c1c; box-shadow: none; transform: none; }
.dash-btn.danger { background: transparent; border: 1px solid rgba(239,68,68,0.2); color: #ef4444; }
.dash-btn.danger:hover { background: rgba(239,68,68,0.08); box-shadow: none; transform: none; }

.form-msg { display: block; min-height: 1rem; font-size: 0.72rem; text-align: center; }
.form-msg.ok { color: #22c55e; }
.form-msg.err { color: #fca5a5; }

/* List items */
.dash-list { display: flex; flex-direction: column; gap: 0.6rem; }
.dash-empty { text-align: center; padding: 3rem 1rem; color: #5b6380; font-size: 0.85rem; line-height: 2; }
.dash-empty a { color: #b91c1c; text-decoration: none; font-weight: 600; }

.dash-item {
  background: rgba(17,24,39,0.5);
  border: 1px solid rgba(91,64,59,0.15);
  border-radius: 10px;
  padding: 0.8rem;
  transition: border-color 0.2s;
}
.dash-item:hover { border-color: rgba(185,28,28,0.2); }

.dash-item-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.dash-item-row strong {
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.7rem;
  color: #dce2f7;
}
.dash-item-row span {
  font-size: 0.65rem;
  color: #5b6380;
  font-family: 'JetBrains Mono',monospace;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-pending { background: rgba(185,28,28,0.1); color: #b91c1c; }
.tag-confirmed { background: rgba(34,197,94,0.1); color: #22c55e; }
.tag-delivered { background: rgba(34,197,94,0.1); color: #22c55e; }
.tag-cancelled { background: rgba(239,68,68,0.1); color: #ef4444; }

.dash-item-detail { font-size: 0.75rem; color: #a0a8c0; margin-bottom: 0.3rem; }
.dash-item-price { font-family: 'JetBrains Mono',monospace; font-weight: 600; font-size: 0.85rem; color: #b91c1c; }
.dash-item-actions { display: flex; gap: 0.4rem; margin-top: 0.5rem; }

/* Edit modal */
#editEventModal {
  position: fixed; inset: 0; background: rgba(7,14,29,0.8); backdrop-filter: blur(6px);
  z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
#editEventModal.open { opacity: 1; pointer-events: all; }
#editEventModal .modal-inner {
  background: rgba(12,19,34,0.98); border: 1px solid rgba(91,64,59,0.25); border-radius: 16px;
  max-width: 500px; width: 100%; max-height: 85vh; display: flex; flex-direction: column;
  transform: scale(0.92); transition: transform 0.35s cubic-bezier(.17,.89,.32,1.2);
}
#editEventModal.open .modal-inner { transform: scale(1); }
#editEventModal .modal-top {
  display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(91,64,59,0.2);
}
#editEventModal .modal-top h3 { font-family: 'JetBrains Mono',monospace; font-size: 0.7rem; color: #b91c1c; margin:0; }
#editEventModal .modal-x { background: none; border: none; color: #5b6380; font-size: 1.3rem; cursor: pointer; }
#editEventModal .modal-scroll { padding: 1rem 1.2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.8rem; }

/* Mobile */
@media (max-width: 768px) {
  .dash-wrapper { flex-direction: column; margin-top: 60px; padding: 0 0.8rem; }
  .dash-sidebar { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; padding: 1rem; gap: 0.5rem; justify-content: center; }
  .dash-avatar { width: 36px; height: 36px; font-size: 1rem; }
  .dash-sidebar h3, .dash-sidebar p { display: none; }
  .dash-nav { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; margin: 0; }
  .dash-nav-btn { font-size: 0.55rem; padding: 0.4rem 0.6rem; }
  .dash-nav-btn .material-symbols-outlined { font-size: 0.9rem; display: none; }
  .dash-logout { width: auto; font-size: 0.55rem; }
  .dashboard { margin: 0; }
  .info-item { padding: 0.6rem; }
  .info-item .info-value { font-size: 0.75rem; }
  .dash-form-row { grid-template-columns: 1fr; }
}
