/* ===== ROOT VARIABLE ===== */
:root {
  --bg: #003f33;
  --card: #1e293b;
  --primary: #22c55e;
  --danger: #ef4444;
  --seat: #334155;
  --selected: #f59e0b;
  --mine: #3b82f6;
}

/* ===== RESET ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== HEADER ===== */
header,
.app-header {
  background: linear-gradient(135deg, #003f33, #005c46);
  padding: 14px 20px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid #facc15;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.title {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== FOOTER ===== */
footer {
  margin-top: auto;
  background: #020617;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  opacity: 0.75;
}

/* ===== CARD / BOX ===== */
.box {
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  background: var(--card);
  padding: 20px;
  border-radius: 14px;
}

/* ===== FORM ===== */
input,
select,
button {
  width: 100%;
  padding: 12px 14px;
  margin-top: 10px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
}

input,
select {
  background: #020617;
  color: #fff;
  outline: none;
}

input:focus,
select:focus {
  outline: 2px solid var(--primary);
}

button {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #000;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(135deg, #020617, #020617dd);
  padding: 30px 26px;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: fadeSlideIn 0.5s ease;
}

.login-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 10px;
}

.login-card h2 {
  margin: 10px 0 4px;
  font-size: 22px;
  font-weight: 700;
}

.login-sub {
  font-size: 13px;
  opacity: 0.75;
  margin-bottom: 18px;
}

.login-footer {
  margin-top: 18px;
  font-size: 12px;
  opacity: 0.6;
}

/* ===== PASSWORD TOGGLE ===== */
.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
}

.toggle-password:hover {
  opacity: 1;
}

/* ===== LOGIN BUTTON LOADING ===== */
#loginBtn {
  position: relative;
  height: 44px;
}

#loginBtn .spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
  margin: auto;
}

#loginBtn.loading .btn-text {
  display: none;
}

#loginBtn.loading .spinner {
  display: block;
}

.login-error {
  margin-top: 12px;
  font-size: 13px;
  color: #f87171;
  min-height: 16px;
}

/* ===== SEAT BOX ===== */
#seatBox {
  display: none;
}

/* ===== STAGE ===== */
.stage {
  background: linear-gradient(to bottom, #475569, #1e293b);
  text-align: center;
  padding: 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-weight: bold;
  letter-spacing: 2px;
  border: 2px dashed #facc15;
}

/* ===== LEGEND ===== */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 13px;
}

.legend div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend .seat {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

/* ===== SEAT MAP ===== */
.seat-map-wrapper {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.row-labels {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.row-label {
  height: 44px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  opacity: 0.7;
}

.seat-map {
  display: grid;
  gap: 8px;
  justify-content: start;
  margin: auto;
}

.seat {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--seat);
  font-size: 12px;

  display: flex;               /* 🔥 ini kunci */
  align-items: center;         /* vertikal */
  justify-content: center;     /* horizontal */

  text-align: center;
  user-select: none;
  transition: 0.2s ease;
}

.seat:hover:not(.booked):not(.mine) {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.aisle {
  width: 44px;
  height: 44px;
}

/* ===== SEAT STATE ===== */
.seat.booked {
  background: var(--danger);
  cursor: not-allowed;
}

.seat.selected {
  background: var(--selected);
}

.seat.mine {
  background: var(--mine);
  color: #fff;
  border: 2px solid #1d4ed8;
  font-weight: bold;
  cursor: not-allowed;
}

.seat.vip {
  background: linear-gradient(135deg, #facc15, #eab308);
  border: 2px solid #b45309;
  color: #000;
  font-weight: bold;
  pointer-events: none; /* ⛔ pengaman ekstra */
  opacity: 0.9;
  cursor: not-allowed;
}

/* ===== ANIMATION ===== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .seat {
    width: 38px;
    height: 38px;
    font-size: 11px;
  }

  .title {
    font-size: 14px;
  }
}