* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #1e6091;
  --primary-dark: #154873;
  --accent: #f9a825;
  --bg: #f5f7fa;
  --text: #2c3e50;
  --muted: #7f8c8d;
  --border: #e0e6ed;
  --success: #27ae60;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  position: sticky; top: 0; z-index: 50;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { text-decoration: none; color: var(--primary); font-size: 24px; display: flex; align-items: center; gap: 10px; }
.badge { background: var(--accent); color: white; font-size: 11px; padding: 3px 8px; border-radius: 3px; font-weight: bold; text-transform: uppercase; }
nav a { color: var(--text); text-decoration: none; margin-left: 24px; font-weight: 500; }
nav a:hover { color: var(--primary); }

/* Views */
.view { padding: 32px 0; min-height: 80vh; }
.view.hidden { display: none; }

/* Hero */
.hero {
  text-align: center;
  padding: 40px 20px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 10px;
  margin-bottom: 32px;
}
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero p { opacity: 0.9; font-size: 16px; }
.badge-info { display: inline-block; background: rgba(255,255,255,0.2); padding: 6px 12px; border-radius: 20px; font-size: 13px; margin-top: 12px; }

h2 { margin-bottom: 20px; font-size: 22px; color: var(--primary); }
h3 { margin: 24px 0 12px; font-size: 17px; color: var(--text); }

/* Grid de hotéis */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.hotel-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s;
  cursor: pointer;
}
.hotel-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.hotel-card .img {
  height: 180px;
  background: linear-gradient(135deg, #ddd, #bbb);
  background-size: cover;
  background-position: center;
}
.hotel-card .body { padding: 16px; }
.hotel-card h3 { margin: 0 0 8px; font-size: 17px; }
.hotel-card .city { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.hotel-card .stars { color: var(--accent); font-size: 14px; }
.hotel-card .price { color: var(--primary); font-weight: bold; margin-top: 12px; font-size: 16px; }

/* Loader */
.loader { padding: 40px; text-align: center; color: var(--muted); }
.loader::after { content: " ..."; animation: dots 1.5s infinite; }
@keyframes dots { 0%,20% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }
.btn-back {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 14px; margin-bottom: 16px; padding: 8px 0;
}

/* Detail */
.detail-hero { background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 24px; }
.detail-hero img { width: 100%; max-height: 350px; object-fit: cover; }
.detail-hero .body { padding: 24px; }
.detail-hero h1 { font-size: 28px; margin-bottom: 8px; }
.detail-hero .address { color: var(--muted); margin-bottom: 12px; }
.detail-hero .description { line-height: 1.6; margin-top: 16px; }

/* Search form */
.search-form {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin: 24px 0;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
label { display: block; font-size: 13px; color: var(--text); font-weight: 500; }
label input, label select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 14px;
  margin-top: 4px;
}
label input:focus, label select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

/* Quartos disponíveis */
.rooms-list { margin-top: 24px; }
.room-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid transparent;
}
.room-card:hover { border-color: var(--border); }
.room-card.selected { border-color: var(--primary); }
.room-card .info h4 { margin-bottom: 4px; }
.room-card .info .meta { color: var(--muted); font-size: 13px; }
.room-card .price { text-align: right; }
.room-card .price .value { font-size: 22px; color: var(--primary); font-weight: bold; }
.room-card .price small { color: var(--muted); }
.room-card button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  margin-left: 16px;
}

/* Booking form */
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); margin-bottom: 24px; }
#booking-form { background: white; padding: 24px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.passenger-block { background: #f9fafc; padding: 16px; border-radius: 6px; margin-bottom: 12px; }
.passenger-block h4 { margin-bottom: 8px; color: var(--primary); }
.hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* Success */
.success-card { background: white; padding: 40px; border-radius: 10px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.08); margin-top: 40px; }
.success-card h1 { color: var(--success); margin-bottom: 24px; }
.success-card .booking-id { background: #e8f5e9; padding: 16px; border-radius: 6px; font-family: monospace; font-size: 18px; color: var(--success); margin: 16px 0; }
.success-card .details { text-align: left; max-width: 500px; margin: 24px auto; padding: 16px; background: var(--bg); border-radius: 6px; }
.success-card .details div { margin: 8px 0; }
.success-card .details strong { color: var(--text); }
.hint-success { color: var(--muted); margin: 20px auto; max-width: 500px; }

/* Debug panel */
#debug {
  position: fixed;
  bottom: 0; right: 0;
  width: 360px;
  max-height: 280px;
  background: #1e1e1e;
  color: #0f0;
  font-family: monospace;
  font-size: 11px;
  padding: 12px;
  overflow-y: auto;
  z-index: 100;
  border-radius: 8px 0 0 0;
  box-shadow: -2px -2px 10px rgba(0,0,0,0.2);
}
#debug h4 { color: #fff; font-size: 12px; margin-bottom: 8px; }
#debug-log div { margin: 4px 0; word-break: break-all; }
#debug-log .ok { color: #0f0; }
#debug-log .err { color: #f55; }
#debug-log .info { color: #5af; }

/* Mobile */
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 24px; }
  nav { display: none; }
  #debug { width: 100%; max-height: 180px; }
}
