/* ==========================================================================
   Auth design system — shared by /login, /delivery, /waiter/login,
   and /forgot-password. One token set, one component library, so every
   screen in the sign-in flow reads as the same product.
   ========================================================================== */

:root{
  --ink:        #15181D;
  --ink-soft:   #2B2F36;
  --paper:      #F7F6F1;
  --paper-dim:  #EFEDE5;
  --line:       #E2DFD5;
  --muted:      #6C7076;
  --muted-2:    #9498A0;
  --danger:     #C7402B;
  --danger-bg:  #FBEEEA;
  --success:    #1F7A52;
  --success-bg: #EAF5EF;

  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  /* overridden inline per page from white-label config */
  --accent: #1E3FE0;
}

*{ box-sizing: border-box; }

body.auth{
  font-family: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.font-display{ font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif; }

[x-cloak]{ display: none !important; }

a{ color: inherit; }

/* ---------- shell ---------- */

.auth-shell{
  min-height: 100vh;
  display: flex;
}

.auth-form-pane{
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 1.75rem;
  position: relative;
  background: var(--paper);
}

@media (min-width: 1024px){
  .auth-form-pane{ width: 46%; padding: 3rem 4rem; }
  .auth-context-pane{ width: 54%; }
}

.auth-form-inner{
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* ---------- brand mark (mobile + form pane) ---------- */

.brand-mark{
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.brand-mark img{ max-height: 30px; width: auto; }
.brand-mark span{
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* ---------- role switcher ---------- */

.role-switch{
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 2.25rem;
}
.role-switch a{
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.6rem 0.5rem;
  border-radius: calc(var(--radius-md) - 6px);
  color: var(--muted);
  text-decoration: none;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.role-switch a:hover{ color: var(--ink); }
.role-switch a.is-active{
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(21,24,29,.45);
}

/* ---------- headline ---------- */

.auth-heading h1{
  font-size: 1.9rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}
.auth-heading p{
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- alerts ---------- */

.alert{
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 1.5rem;
}
.alert svg{ flex-shrink: 0; margin-top: 1px; width: 18px; height: 18px; }
.alert--error{ background: var(--danger-bg); color: var(--danger); }
.alert--success{ background: var(--success-bg); color: var(--success); }

/* ---------- form ---------- */

.field{ margin-bottom: 1.25rem; }
.field-row{ display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; }
.field label{
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: 2px;
}
.field-link{
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.field-link:hover{ text-decoration: underline; }

.input-wrap{ position: relative; }
.input-wrap .icon-left{
  position: absolute; left: 14px; top: 0; bottom: 0;
  display: flex; align-items: center;
  color: var(--muted-2);
  pointer-events: none;
}
.input-wrap .icon-left svg{ width: 18px; height: 18px; }

.input-wrap input{
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-wrap input::placeholder{ color: var(--muted-2); font-weight: 400; }
.input-wrap input:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.input-wrap input.has-toggle{ padding-right: 2.8rem; }

.pass-toggle{
  position: absolute; right: 6px; top: 0; bottom: 0;
  display: flex; align-items: center;
  padding: 0 0.6rem;
  color: var(--muted-2);
  background: none; border: none; cursor: pointer;
}
.pass-toggle:hover{ color: var(--accent); }
.pass-toggle svg{ width: 18px; height: 18px; }

/* ---------- button ---------- */

.btn-primary{
  width: 100%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  cursor: pointer;
  box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-primary:hover{ transform: translateY(-1px); }
.btn-primary:active{ transform: translateY(0); }
.btn-primary:disabled{ opacity: .72; cursor: not-allowed; transform: none; }
.btn-primary svg{ width: 17px; height: 17px; }

.spinner{
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ---------- divider / footer links ---------- */

.divider{
  display: flex; align-items: center; gap: 0.9rem;
  margin: 1.75rem 0 1.1rem;
  font-size: 0.74rem;
  color: var(--muted-2);
  font-weight: 500;
}
.divider::before, .divider::after{
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.footer-link{
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}
.footer-link a{
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.footer-link a:hover{ text-decoration: underline; }

.back-link{
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.82rem; font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.back-link svg{ width: 15px; height: 15px; transition: transform .15s ease; }
.back-link:hover svg{ transform: translateX(-3px); }

/* ---------- context pane (right side) ---------- */

.auth-context-pane{
  display: none;
  position: relative;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 3.5rem;
}
@media (min-width: 1024px){ .auth-context-pane{ display: flex; } }

.context-dots{
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.4px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 70% 30%, black, transparent 75%);
}

.context-content{
  position: relative;
  z-index: 1;
  max-width: 430px;
  width: 100%;
}

.context-badge{
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 55%, #ffffff 10%);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.75rem;
  box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--accent) 80%, transparent);
}
.context-badge svg{ width: 26px; height: 26px; color: #fff; }

.context-content h2{
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin-bottom: 0.85rem;
}
.context-content p{
  font-size: 0.95rem;
  color: rgba(255,255,255,.62);
  line-height: 1.6;
  margin-bottom: 2.25rem;
}

/* live mock widgets — small, functional illustrations of each role's day */

.mock-panel{
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
}
.mock-panel-label{
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,.4);
  margin-bottom: 0.85rem;
}

/* store: order queue */
.mock-order-row{
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(255,255,255,.07);
}
.mock-order-row:first-of-type{ border-top: none; }
.mock-order-id{ font-family: 'Space Grotesk', monospace; font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,.85); }
.mock-order-item{ font-size: 0.78rem; color: rgba(255,255,255,.5); }
.mock-pill{
  font-size: 0.66rem; font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.mock-pill--wait{ background: rgba(255,255,255,.1); color: rgba(255,255,255,.7); }
.mock-pill--go{ background: color-mix(in srgb, var(--accent) 35%, transparent); color: #fff; }

/* delivery: route timeline */
.mock-route{ position: relative; padding-left: 1.3rem; }
.mock-route::before{
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1.5px;
  background: rgba(255,255,255,.15);
}
.mock-stop{ position: relative; padding-bottom: 1.05rem; }
.mock-stop:last-child{ padding-bottom: 0; }
.mock-stop::before{
  content: ''; position: absolute; left: -1.3rem; top: 3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--ink);
}
.mock-stop-name{ font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,.85); }
.mock-stop-meta{ font-size: 0.74rem; color: rgba(255,255,255,.45); }

/* waiter: table map */
.mock-tables{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.mock-table{
  aspect-ratio: 1; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  border: 1.5px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.55);
}
.mock-table--occupied{
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  border-color: transparent;
  color: #fff;
}

.context-footnote{
  margin-top: 1.75rem;
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 600;
  color: rgba(255,255,255,.4);
}
.context-footnote svg{ width: 14px; height: 14px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .btn-primary, .spinner{ animation: none !important; transition: none !important; }
}