/* =============================================
   LAYOUT.CSS — Login, Header, Nav, Container
   Breakpoints: 820px · 640px · 480px · 360px
   ============================================= */

/* ══════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════ */
#loginScreen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--navy);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 2.5rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}
#loginScreen.out { opacity: 0; pointer-events: none; }

/* layout de 2 colunas */
.ls-layout {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  max-width: 980px;
  animation: risein 0.7s cubic-bezier(.22,1,.36,1) both;
}

.ls-left {
  flex: 0 0 400px;
  max-width: 400px;
}

.ls-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem .75rem;
  gap: 10px;
  flex-shrink: 0;
}
.ls-divider-line {
  flex: 1;
  width: 1px;
  min-height: 50px;
  background: linear-gradient(to bottom, transparent, rgba(201,169,110,.2), transparent);
}
.ls-divider-text {
  font-size: .7rem;
  font-weight: 600;
  color: rgba(255,255,255,.2);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ls-right {
  flex: 1;
  min-width: 0;
}

/* ── Login Card ── */
.login-card {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 40px 80px rgba(0,0,0,.4);
}

.logo-img       { height: 42px; width: auto; }
.login-logo-img { width: 110px; margin-bottom: 10px; }

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo h1 {
  font-family: var(--ff-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: .02em;
  margin-top: 8px;
}
.login-logo p {
  font-size: .78rem;
  color: rgba(255,255,255,.4);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
}
.login-tab {
  flex: 1;
  padding: 9px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: rgba(255,255,255,.4);
  font-family: var(--ff-body);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  letter-spacing: .04em;
}
.login-tab.active {
  background: rgba(201,169,110,.15);
  border-color: var(--gold);
  color: var(--gold2);
}

.field          { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,169,110,.25);
  border-radius: 10px;
  color: var(--white);
  font-family: var(--ff-body);
  font-size: .9rem;
  transition: border-color .3s, box-shadow .3s;
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,.12);
}
.field input::placeholder { color: rgba(255,255,255,.22); }

.login-err {
  font-size: .8rem;
  color: #e88;
  text-align: center;
  margin-bottom: .65rem;
  min-height: 1.1rem;
}

.login-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold3) 100%);
  color: var(--navy);
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(201,169,110,.3);
}

.demo-note {
  text-align: center;
  margin-top: 1.1rem;
  font-size: .74rem;
  color: rgba(255,255,255,.26);
  border-top: 1px solid rgba(255,255,255,.07);
  padding-top: 1rem;
}

/* ── Visitor Card ── */
.visitor-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(201,169,110,.12);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.visitor-header        { margin-bottom: 1.25rem; }
.visitor-badge {
  display: inline-block;
  background: rgba(201,169,110,.12);
  border: 1px solid rgba(201,169,110,.25);
  color: var(--gold2);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: .65rem;
}
.visitor-header h2 {
  font-family: var(--ff-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold2);
  margin-bottom: .35rem;
  line-height: 1.3;
}
.visitor-header p {
  font-size: .8rem;
  color: rgba(255,255,255,.36);
  line-height: 1.5;
}

.visitor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.visitor-select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,169,110,.25);
  border-radius: 10px;
  color: var(--white);
  font-family: var(--ff-body);
  font-size: .88rem;
  cursor: pointer;
  transition: border-color .3s;
}
.visitor-select:focus  { outline: none; border-color: var(--gold); }
.visitor-select option { background: var(--navy2); color: var(--white); }

.visitor-next-btn {
  width: 100%;
  padding: 12px;
  margin-top: .5rem;
  background: rgba(201,169,110,.12);
  border: 1px solid rgba(201,169,110,.3);
  border-radius: 10px;
  color: var(--gold2);
  font-family: var(--ff-body);
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .02em;
}
.visitor-next-btn:hover {
  background: rgba(201,169,110,.2);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.visitor-back-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  font-family: var(--ff-body);
  font-size: .78rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: .5rem;
  transition: color .2s;
}
.visitor-back-btn:hover       { color: var(--gold2); }
.visitor-back-btn--spaced     { margin-top: 1rem; }

.visitor-summary {
  background: rgba(201,169,110,.07);
  border: 1px solid rgba(201,169,110,.2);
  border-radius: 12px;
  padding: .9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.visitor-confirm-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold3) 100%);
  border: none;
  border-radius: 10px;
  color: var(--navy);
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.visitor-confirm-btn:hover    { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(201,169,110,.25); }
.visitor-confirm-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.visitor-err {
  font-size: .76rem;
  color: #e88;
  margin-top: .4rem;
  min-height: 1rem;
}

.visitor-success        { text-align: center; padding: 1.5rem 0; }
.visitor-success-ico    { font-size: 2.8rem; margin-bottom: .6rem; }
.visitor-success h3 {
  font-family: var(--ff-display);
  font-size: 1.45rem;
  color: var(--gold2);
  margin-bottom: .65rem;
}
.visitor-success p { font-size: .83rem; color: rgba(255,255,255,.5); line-height: 1.6; }

/* utilitários de inline → class */
.input-uppercase { text-transform: uppercase; }

/* ══════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════ */
header {
  background: var(--navy);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 500;
  border-bottom: 1px solid rgba(201,169,110,.12);
}

.hdr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: .02em;
}

.hdr-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .78rem;
  color: var(--navy);
  flex-shrink: 0;
}

.hdr-name  { font-size: .82rem; font-weight: 500; color: rgba(255,255,255,.7); }
.hdr-role  { font-size: .7rem;  color: var(--gold); font-weight: 600; letter-spacing: .05em; }

.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .73rem;
  color: rgba(255,255,255,.3);
  text-decoration: underline;
  font-family: var(--ff-body);
  transition: color .2s;
}
.logout-btn:hover { color: #e88; }

/* brand text oculto em telas muito pequenas */
.brand-text { display: inline; }

/* ══════════════════════════════════════════════
   NAV BAR
══════════════════════════════════════════════ */
.nav-bar {
  background: var(--navy2);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-bar::-webkit-scrollbar { display: none; }

.nav-tab {
  flex: 0 0 auto;
  padding: 13px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,.42);
  font-family: var(--ff-body);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .25s;
}
.nav-tab:hover  { color: var(--gold2); }
.nav-tab.active { color: var(--gold2); border-bottom-color: var(--gold); }

.nav-tab--highlight {
  color: var(--gold3) !important;
  border-bottom: 2px solid var(--gold3);
  font-weight: 600;
}
.nav-tab--highlight.active {
  color: var(--gold) !important;
  border-bottom-color: var(--gold);
}

/* ══════════════════════════════════════════════
   CONTAINER / PAGES
══════════════════════════════════════════════ */
#app { display: none; }
#app.visible { display: block; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page        { display: none; }
.page.active { display: block; animation: fadein .35s ease; }

/* ══════════════════════════════════════════════
   RESPONSIVE — mobile-first breakpoints
══════════════════════════════════════════════ */

/* ── ≤ 820px + 768px: login empilhado, app ajustes ── */
@media (max-width: 820px) {
  #loginScreen { padding: 1.5rem 1rem; align-items: flex-start; }

  .ls-layout {
    flex-direction: column;
    max-width: 500px;
    gap: 1.25rem;
    margin: 0 auto;
  }
  .ls-left  { flex: unset; max-width: 100%; width: 100%; }
  .ls-right { width: 100%; }

  .ls-divider {
    flex-direction: row;
    padding: 0;
    gap: 12px;
    width: 100%;
    justify-content: center;
  }
  .ls-divider-line {
    flex: 1;
    width: auto;
    height: 1px;
    min-height: unset;
    background: linear-gradient(to right, transparent, rgba(201,169,110,.2), transparent);
  }

  .container { padding: 1.5rem 1rem; }
  header     { padding: 0 1rem; }
}

/* ── ≤ 768px ── */
@media (max-width: 768px) {
  .container { padding: 1.5rem 1rem; }
  header     { padding: 0 1rem; }
}

/* ── ≤ 640px ── */
@media (max-width: 640px) {
  .login-card    { padding: 1.75rem 1.25rem; }
  .login-logo h1 { font-size: 1.85rem; }
  .visitor-card  { padding: 1.5rem 1.1rem; }
  .visitor-row   { grid-template-columns: 1fr; gap: 0; }

  header       { height: 54px; }
  .brand-text  { display: none; }       /* só o logo no mobile */
  .hdr-name, .hdr-role { font-size: .72rem; }

  .nav-tab { padding: 11px 12px; font-size: .75rem; }

  .container { padding: 1.25rem .85rem; }
}

/* ── ≤ 480px ── */
@media (max-width: 480px) {
  #loginScreen   { padding: 1rem .75rem; }
  .login-card    { padding: 1.5rem 1rem; }
  .visitor-card  { padding: 1.25rem .9rem; }
  .ls-layout     { max-width: 100%; }
}

/* ── ≤ 360px: telas muito pequenas ── */
@media (max-width: 360px) {
  .login-logo h1 { font-size: 1.6rem; }
  .login-btn     { font-size: .85rem; }
  .container     { padding: 1rem .65rem; }
}
