/**
 * Commensal auth gate — aligned with order/confirmed guest shells (cream, Poppins, ROU primary).
 */
:root {
  --c-bg: var(--rou-cream, #fff7ed);
  --c-surface: var(--rou-surface, #fff);
  --c-text: var(--rou-text, #3f3f46);
  --c-text-strong: var(--rou-text-strong, #1e1e1e);
  --c-muted: var(--rou-text-light, #71717a);
  --c-border: color-mix(in srgb, var(--c-text) 12%, transparent);
  --c-accent: var(--rou-primary, #d90f32);
  --c-accent-hover: var(--rou-primary-dark, #b00d29);
  --c-on-accent: #fff;
  --font-body: var(--rou-font-body, "Poppins", system-ui, -apple-system, sans-serif);
  --font-display: var(--rou-font-display, "Poppins", system-ui, -apple-system, sans-serif);
  --radius-card: 1.25rem;
  --radius-input: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 16px 40px rgba(26, 26, 26, 0.08);
  --touch: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.rou-commensal-auth-shell {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.rou-commensal-auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right, 0px))
    max(1.25rem, env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
}

.rou-commensal-auth__card {
  width: 100%;
  max-width: 400px;
  background: var(--c-surface);
  border-radius: var(--radius-card);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--c-border);
}

.rou-commensal-auth__logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 1.25rem;
  text-decoration: none;
  line-height: 1;
}

.rou-commensal-auth__logo-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--c-accent);
}

.rou-commensal-auth__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--c-text-strong);
}

.rou-commensal-auth__lead {
  margin: 0 0 1.35rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--c-muted);
}

.rou-commensal-auth__notice {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  line-height: 1.45;
}

.rou-commensal-auth__notice--error {
  background: color-mix(in srgb, var(--rou-danger, #dc2626) 8%, var(--c-surface));
  color: #991b1b;
  border: 1px solid color-mix(in srgb, var(--rou-danger, #dc2626) 22%, transparent);
}

.rou-commensal-auth__notice--success {
  background: color-mix(in srgb, var(--rou-success, #16a34a) 8%, var(--c-surface));
  color: #166534;
  border: 1px solid color-mix(in srgb, var(--rou-success, #16a34a) 22%, transparent);
}

.rou-commensal-auth__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0 0.85rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
}

.rou-commensal-auth__divider::before,
.rou-commensal-auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.rou-commensal-auth__password {
  margin-top: 0.25rem;
}

.rou-commensal-auth__password summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--c-muted);
  list-style: none;
}

.rou-commensal-auth__password summary::-webkit-details-marker {
  display: none;
}

.rou-commensal-auth__submit--secondary {
  background: var(--c-surface);
  color: var(--c-text-strong);
  border: 1px solid var(--c-border);
}

.rou-commensal-auth__google-unavail {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-input);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--c-muted);
  background: var(--rou-surface-muted, #f8f8f7);
  border: 1px dashed var(--c-border);
  text-align: center;
}

.rou-google-commensal-wrap {
  margin: 0 0 0.25rem !important;
  text-align: center;
}

.rou-google-commensal-wrap .rou-google-btn {
  font-family: var(--font-body);
  border-radius: var(--radius-input);
  min-height: var(--touch);
}

.rou-google-commensal-wrap .rou-google-divider {
  margin: 1.15rem 0 1.25rem;
  font-family: var(--font-body);
}

.rou-commensal-auth__tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.15rem;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--rou-surface-muted, #f4f4f5);
}

.rou-commensal-auth__tab {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.75rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--c-muted);
  background: transparent;
  transition: background 0.2s var(--rou-ease, ease), color 0.2s var(--rou-ease, ease);
}

.rou-commensal-auth__tab.is-active {
  background: var(--c-accent);
  color: var(--c-on-accent);
  box-shadow: var(--rou-shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.06));
}

.rou-commensal-auth__tab:not(.is-active):hover,
.rou-commensal-auth__tab:not(.is-active):focus {
  color: var(--c-text-strong);
}

.rou-commensal-auth__field {
  display: block;
  margin-bottom: 0.9rem;
}

.rou-commensal-auth__field span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text-strong);
}

.rou-commensal-auth__field input {
  width: 100%;
  min-height: var(--touch);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-input);
  border: 1px solid var(--c-border);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
  color: var(--c-text-strong);
  background: var(--c-surface);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.rou-commensal-auth__field input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--c-accent) 45%, var(--c-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 18%, transparent);
}

.rou-commensal-auth__hint {
  margin: -0.25rem 0 0.9rem;
  font-size: 0.75rem;
  color: var(--c-muted);
}

.rou-commensal-auth__submit {
  width: 100%;
  min-height: var(--touch);
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--c-accent);
  color: var(--c-on-accent);
  transition: background 0.2s, transform 0.1s;
}

.rou-commensal-auth__submit:hover,
.rou-commensal-auth__submit:focus {
  background: var(--c-accent-hover);
}

.rou-commensal-auth__submit:active {
  transform: scale(0.99);
}

.rou-commensal-auth__staff {
  margin: 1.35rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--c-border);
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.rou-commensal-auth__staff a {
  color: var(--c-muted);
  font-weight: 600;
  text-decoration: none;
}

.rou-commensal-auth__staff a:hover,
.rou-commensal-auth__staff a:focus {
  color: var(--c-accent);
  text-decoration: underline;
}
