/* ============================================================================
   Urambo Suites — WiFi Portal
   Design tokens derived from brand mark: nested-bracket architectural motif,
   ink/stone palette. The bracket motif is reused as a functional UI device
   (frame corners + input focus states) rather than purely decorative.
   ============================================================================ */

:root {
  --ink:        #1d1f21;
  --ink-soft:   #24262a;
  --ink-line:   #34363a;
  --stone:      #bcb5a2;
  --stone-dim:  #8f8a79;
  --stone-soft: #e4dfd2;
  --cream:      #f4f1e9;
  --error:      #c1694f;
  --success:    #93a582;

  --font-display: 'Big Shoulders', 'Archivo Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--stone-soft);
  font-family: var(--font-body);
  min-height: 100vh;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(188,181,162,0.06), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(188,181,162,0.05), transparent 40%),
    var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- Bracket frame (signature element) --------------------------------- */
.bracket-shell {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 46px 40px 40px;
}

.bracket {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 2px solid var(--stone);
  opacity: 0;
  transform: scale(0.6);
  animation: bracket-in 0.6s var(--ease) forwards;
}
.bracket.tl { top: 0; left: 0; border-right: none; border-bottom: none; animation-delay: 0.05s; }
.bracket.tr { top: 0; right: 0; border-left: none; border-bottom: none; animation-delay: 0.12s; }
.bracket.bl { bottom: 0; left: 0; border-right: none; border-top: none; animation-delay: 0.19s; }
.bracket.br { bottom: 0; right: 0; border-left: none; border-top: none; animation-delay: 0.26s; }

@keyframes bracket-in {
  to { opacity: 1; transform: scale(1); }
}

.card {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 40px 36px;
  opacity: 0;
  animation: card-in 0.5s var(--ease) 0.32s forwards;
}

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

/* ---- Logo mark ---------------------------------------------------------- */
.mark {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.mark svg { width: 46px; height: 46px; }

.wordmark {
  text-align: center;
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.02em;
  color: var(--cream);
  text-transform: uppercase;
}
.wordmark-sub {
  text-align: center;
  margin: 0 0 32px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.55em;
  color: var(--stone-dim);
  text-transform: uppercase;
  padding-left: 0.55em; /* optical balance for the tracking */
}

.step-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-dim);
  margin: 0 0 6px;
}
.step-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}
.step-copy {
  font-size: 14px;
  line-height: 1.55;
  color: var(--stone);
  margin: 0 0 28px;
}
.step-copy strong { color: var(--cream); font-weight: 600; }

/* ---- Form elements -------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--stone-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.field input {
  width: 100%;
  padding: 13px 14px;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder { color: #5a5c60; }

/* Bracket-corner focus state instead of a generic glow ring */
.field.bracket-focus { position: relative; }
.field.bracket-focus input:focus {
  border-color: transparent;
}
.field.bracket-focus::before,
.field.bracket-focus::after {
  content: '';
  position: absolute;
  top: -3px; bottom: 15px;
  width: 10px;
  border: 2px solid var(--stone);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
  pointer-events: none;
}
.field.bracket-focus::before { left: -3px; border-right: none; }
.field.bracket-focus::after  { right: -3px; border-left: none; }
.field.bracket-focus:focus-within::before,
.field.bracket-focus:focus-within::after { opacity: 1; }

/* OTP digit input */
.otp-input {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.otp-input input {
  width: 44px;
  height: 54px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  padding: 0;
}

.btn {
  width: 100%;
  padding: 14px 16px;
  background: var(--stone);
  color: var(--ink);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.12s var(--ease);
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--cream); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--stone);
  border: 1px solid var(--ink-line);
}
.btn-ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--stone-dim); }

.link-btn {
  background: none;
  border: none;
  color: var(--stone);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}
.link-btn:hover { color: var(--cream); }
.link-btn:disabled { color: var(--stone-dim); cursor: default; text-decoration: none; }

.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.msg {
  font-size: 13px;
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  border: 1px solid transparent;
  display: none;
}
.msg.show { display: block; }
.msg.error { color: var(--error); border-color: rgba(193,105,79,0.35); background: rgba(193,105,79,0.08); }
.msg.success { color: var(--success); border-color: rgba(147,165,130,0.35); background: rgba(147,165,130,0.08); }

/* ---- Device list (5-device limit flow) ------------------------------------ */
.device-list { list-style: none; margin: 0 0 24px; padding: 0; }
.device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--ink-line);
}
.device-item:last-child { border-bottom: none; }
.device-info { display: flex; flex-direction: column; gap: 3px; }
.device-name { font-size: 14px; color: var(--cream); font-weight: 500; }
.device-meta { font-size: 12px; color: var(--stone-dim); font-family: var(--font-mono); }
.device-remove {
  font-size: 12px;
  color: var(--error);
  background: none;
  border: 1px solid rgba(193,105,79,0.35);
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s var(--ease);
}
.device-remove:hover { background: rgba(193,105,79,0.12); }

.limit-banner {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--stone-dim);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(29,31,33,0.25);
  border-top-color: var(--ink);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.view { display: none; }
.view.active { display: block; }

.success-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.success-icon svg { width: 24px; height: 24px; }

.property-line {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-line);
  margin-top: 28px;
  text-transform: uppercase;
}
