/* ── Mando Garaje — tema base (personalizable por usuario) ── */

:root {
  --bg-1: #0a0a0d;
  --bg-2: #121217;
  --card-bg: #16161d;
  --card-border: #2a2a35;
  --gold: #c9a45c;
  --gold-soft: #e8cf9a;
  --gold-dim: #8a723f;
  --text-primary: #ece7dc;
  --text-muted: #7b7a82;
  --danger: #b5493f;
  --radius-card: 28px;
  --radius-btn: 50%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  font-family: 'Jost', sans-serif;
  background: radial-gradient(circle at 50% 0%, var(--bg-2), var(--bg-1) 70%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

.scene {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.card {
  width: 100%;
  background: linear-gradient(180deg, var(--card-bg), #101015);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 44px 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

/* ── Brand ── */
.brand {
  text-align: center;
  margin-bottom: 40px;
}

.brand-mark {
  display: block;
  width: 34px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 18px;
}

.brand h1 {
  font-family: 'Bodoni Moda', serif;
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.subtitle {
  margin-top: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* ── Gate button ── */
.gate {
  position: relative;
  margin-bottom: 32px;
}

.gate-btn {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(201, 164, 92, 0.35);
  background:
    radial-gradient(circle at 32% 28%, #2a2a34, #16161c 65%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow:
    0 20px 40px -12px rgba(0,0,0,0.6),
    inset 0 1px 1px rgba(255,255,255,0.06),
    inset 0 -12px 20px rgba(0,0,0,0.4);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gate-btn .ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.gate-btn[data-state="open"] .ring {
  border-color: rgba(201, 164, 92, 0.55);
  box-shadow: 0 0 26px rgba(201, 164, 92, 0.25);
}

.gate-btn.pressing {
  transform: scale(0.94);
  border-color: rgba(201, 164, 92, 0.8);
}

.gate-btn.busy {
  animation: pulse 0.9s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 20px 40px -12px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.06), inset 0 -12px 20px rgba(0,0,0,0.4), 0 0 0 rgba(201,164,92,0); }
  50%      { box-shadow: 0 20px 40px -12px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.06), inset 0 -12px 20px rgba(0,0,0,0.4), 0 0 24px rgba(201,164,92,0.35); }
}

.gate-icon {
  width: 62px;
  height: 62px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gate-frame {
  fill: none;
  stroke: var(--gold-soft);
  stroke-width: 2.5;
}

.gate-slat {
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  transform-origin: 50px 50px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.gate-btn[data-state="open"] .gate-slat {
  opacity: 0.55;
}
.gate-btn[data-state="open"] line:nth-of-type(1) { transform: translateY(-12px) scaleY(0.3); }
.gate-btn[data-state="open"] line:nth-of-type(2) { transform: translateY(-4px) scaleY(0.3); }
.gate-btn[data-state="open"] line:nth-of-type(3) { transform: translateY(4px) scaleY(0.3); }

/* ── Status ── */
.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
}

.status-label {
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  color: var(--gold-soft);
}

.status-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── Footer ── */
.footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

/* ── Responsive ── */
@media (max-width: 420px) {
  .card { padding: 36px 24px 30px; }
  .gate-btn { width: 148px; height: 148px; }
  .brand h1 { font-size: 1.7rem; }
}

.footer {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer .logout {
  color: var(--gold-dim);
  text-decoration: none;
  border-left: 1px solid var(--card-border);
  padding-left: 14px;
  transition: color 0.2s ease;
}
.footer .logout:hover {
  color: var(--gold-soft);
}

.card {
  position: relative;
}

.gear-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s ease, transform 0.3s ease;
}
.gear-btn:hover {
  border-color: var(--gold-dim);
  transform: rotate(45deg);
}
.gear-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}
.gear-btn:hover svg {
  fill: var(--gold-soft);
}

.hint-arrow {
  margin-top: 14px;
  width: 0;
  height: 0;
  border: none;
  background: none;
  padding: 10px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 14px solid var(--gold-dim);
  cursor: pointer;
}
.hint-arrow:hover { border-bottom-color: var(--gold-soft); }

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 40;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70vh;
  max-height: 560px;
  background: linear-gradient(180deg, #14141a, #0d0d11);
  border-top: 1px solid var(--card-border);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 41;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}
.sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--card-border);
  margin: 12px 0 4px;
}

.sheet-frame {
  width: 100%;
  height: 100%;
  border: none;
}
