/* ─────────────────────────────────────────────────
   The Hello Hotel — Captive Portal
   ───────────────────────────────────────────────── */

:root {
  --navy:        #0f172a;
  --navy-mid:    #1e3a5f;
  --navy-light:  #2d5a8e;
  --gold:        #c9a84c;
  --gold-light:  #e6c97a;
  --white:       #ffffff;
  --gray-50:     #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-400:    #94a3b8;
  --gray-500:    #64748b;
  --gray-700:    #334155;
  --gray-800:    #1e293b;
  --success:     #059669;
  --success-bg:  #ecfdf5;
  --error:       #dc2626;
  --error-bg:    #fef2f2;
  --error-border:#fecaca;
  --radius-lg:   18px;
  --radius-md:   12px;
  --radius-sm:   8px;
  --shadow-card: 0 32px 64px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.2);
  --transition:  0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Body & Background ─────────────────────────────── */
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--navy);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(145deg, #0a0f1e 0%, #0f172a 30%, #1a2f4e 65%, #0d2137 100%);
  background-size: 300% 300%;
  animation: bgDrift 20s ease infinite;
}

.bg::before,
.bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.bg::before {
  width: 700px;
  height: 700px;
  top: -20%;
  right: -15%;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 65%);
  animation: orb 22s ease-in-out infinite;
}

.bg::after {
  width: 500px;
  height: 500px;
  bottom: -10%;
  left: -10%;
  background: radial-gradient(circle, rgba(45,90,142,0.18) 0%, transparent 65%);
  animation: orb 28s ease-in-out infinite reverse;
}

@keyframes bgDrift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

@keyframes orb {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-40px) scale(1.06); }
}

/* ── Card ──────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 24px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: cardIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

/* ── Card Header ───────────────────────────────────── */
.card-header {
  position: relative;
  padding: 36px 32px 30px;
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 100%);
  text-align: center;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* Language switcher */
.lang-switcher {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.lang-btn {
  padding: 4px 9px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.lang-btn:hover {
  background: rgba(201,168,76,0.18);
  border-color: rgba(201,168,76,0.4);
  color: var(--gold-light);
}

.lang-btn.active {
  background: rgba(201,168,76,0.22);
  border-color: rgba(201,168,76,0.55);
  color: var(--gold-light);
}

/* Hotel branding */
.hotel-logo-wrap {
  margin-bottom: 14px;
}

.hotel-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.hotel-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: var(--gold);
}

.hotel-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hotel-sub {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Staff badge */
.staff-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 22px;
}

/* ── Card Body ─────────────────────────────────────── */
.card-body {
  padding: 28px 32px 32px;
}

/* ── Tabs ──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 3px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover:not(.active) {
  color: var(--gray-700);
}

.tab-btn.active {
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ── Tab panels ────────────────────────────────────── */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeSlide 0.2s ease both;
}

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

/* ── Form ──────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
  font-size: 14px;
}

/* ── Submit Button ─────────────────────────────────── */
.btn-submit {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(201,168,76,0.15) 100%);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-submit:hover:not(:disabled)::after { opacity: 1; }

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15,23,42,0.4);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-submit.loading .spinner   { display: block; }
.btn-submit.loading .btn-label { display: none; }

/* ── Error Message ─────────────────────────────────── */
.error-msg {
  display: none;
  margin-top: 14px;
  padding: 11px 14px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 13px;
  line-height: 1.5;
  animation: fadeIn 0.25s ease;
}

.error-msg.visible { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0);     }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-7px); }
  40%     { transform: translateX(7px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}

.shake { animation: shake 0.38s ease; }

/* ── Success Screen ─────────────────────────────────── */
.success-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px 20px;
  min-height: 260px;
  justify-content: center;
}

.success-screen.visible { display: flex; }

.success-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success) 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  animation: popIn 0.5s cubic-bezier(0.68,-0.55,0.265,1.55) both;
  box-shadow: 0 12px 32px rgba(5,150,105,0.35);
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.success-msg {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.65;
  max-width: 280px;
}

.instagram-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 11px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 6px 20px rgba(131,58,180,0.35);
}
.instagram-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.instagram-btn:active { opacity: 0.75; transform: translateY(0); }

.success-redirect {
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray-400);
  max-width: 280px;
  line-height: 1.5;
}

.success-redirect strong {
  color: var(--navy-mid);
  font-weight: 700;
}

/* ── Card Footer ───────────────────────────────────── */
.card-footer {
  padding: 14px 32px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  text-align: center;
}

.footer-text {
  font-size: 11.5px;
  color: var(--gray-400);
  letter-spacing: 0.02em;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 360px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    align-items: flex-start;
    background: var(--navy);
  }

  .card {
    margin: 0;
    border-radius: 0;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
  }

  .card-body { flex: 1; }

  .card-header { padding: 28px 24px 22px; }
  .card-body   { padding: 22px 24px 28px; }
  .card-footer { padding: 12px 24px; }

  .hotel-name { font-size: 22px; }
}
