/* BIMAR auth + welcome — independent of Berry auth-main */
:root {
  --bimar-red: #cb342b;
  --bimar-red-deep: #9e241e;
  --bimar-ink: #1a1f26;
  --bimar-ink-soft: #2c343f;
  --bimar-muted: #6a7280;
  --bimar-line: rgba(26, 31, 38, 0.14);
  --bimar-paper: #f4f2ef;
  --bimar-white: #ffffff;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --auth-panel-w: min(440px, 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.bimar-auth,
body.bimar-welcome {
  font-family: var(--font-body);
  color: var(--bimar-ink);
  background: var(--bimar-ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ---------- Login shell ---------- */
.auth-shell {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  color: var(--bimar-white);
  padding: clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: flex-end;
}

.auth-brand__media {
  position: absolute;
  inset: 0;
  background-image: var(--auth-bg);
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  animation: auth- ken 18s var(--ease) infinite alternate;
}

.auth-brand__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(26, 31, 38, 0.35) 0%, rgba(26, 31, 38, 0.72) 48%, rgba(158, 36, 30, 0.78) 100%),
    linear-gradient(0deg, rgba(26, 31, 38, 0.55), transparent 42%);
}

.auth-brand__content {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  animation: auth-rise 0.9s var(--ease) both;
}

.auth-brand__logo img {
  display: block;
  height: 42px;
  width: auto;
  margin-bottom: 2.5rem;
}

.auth-brand__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.auth-brand__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.auth-brand__lead {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  max-width: 34ch;
}

.auth-panel {
  background: var(--bimar-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.auth-panel__inner {
  width: var(--auth-panel-w);
  animation: auth-rise 0.7s 0.12s var(--ease) both;
}

.auth-panel__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bimar-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.auth-panel__back:hover {
  color: var(--bimar-red);
}

.auth-panel__header {
  margin-bottom: 1.75rem;
}

.auth-panel__logo {
  display: inline-block;
  margin-bottom: 1.35rem;
  text-decoration: none;
}

.auth-panel__logo img {
  display: block;
  width: auto;
  height: clamp(88px, 14vw, 120px);
  max-width: min(420px, 100%);
  object-fit: contain;
  object-position: left center;
}

.auth-panel__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.auth-panel__subtitle {
  margin: 0;
  color: var(--bimar-muted);
  font-size: 0.98rem;
}

.auth-alert {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(203, 52, 43, 0.28);
  background: rgba(203, 52, 43, 0.08);
  color: var(--bimar-red-deep);
  font-size: 0.9rem;
  border-radius: 6px;
}

.auth-alert:empty {
  display: none;
}

.auth-alert ul {
  margin: 0;
  padding-left: 1.1rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
}

.auth-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bimar-ink-soft);
}

.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="text"] {
  width: 100%;
  border: 1px solid var(--bimar-line);
  background: var(--bimar-white);
  border-radius: 6px;
  padding: 0.9rem 0.95rem;
  font: inherit;
  font-size: 0.98rem;
  color: var(--bimar-ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(203, 52, 43, 0.55);
  box-shadow: 0 0 0 3px rgba(203, 52, 43, 0.14);
}

.auth-field__error {
  color: var(--bimar-red-deep);
  font-size: 0.8rem;
  min-height: 1em;
}

.auth-field__error:empty {
  display: none;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.15rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--bimar-muted);
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--bimar-red);
}

.auth-submit {
  margin-top: 0.35rem;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--bimar-red);
  color: var(--bimar-white);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.95rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.auth-submit:hover:not(:disabled) {
  background: var(--bimar-red-deep);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.auth-panel__note {
  margin: 1.5rem 0 0;
  font-size: 0.82rem;
  color: var(--bimar-muted);
  line-height: 1.45;
}

/* ---------- Welcome (distinct page) ---------- */
body.bimar-welcome {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bimar-ink);
}

.welcome-top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 2.5rem);
}

.welcome-top__brand img {
  height: 36px;
  width: auto;
  display: block;
}

.welcome-top__logout button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.welcome-top__logout button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.55);
}

.welcome-hero {
  position: relative;
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 6rem 1.5rem 3rem;
  overflow: hidden;
  background-image: var(--welcome-bg);
  background-size: cover;
  background-position: center;
}

.welcome-hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26, 31, 38, 0.55) 0%, rgba(26, 31, 38, 0.78) 55%, rgba(26, 31, 38, 0.9) 100%),
    linear-gradient(90deg, rgba(203, 52, 43, 0.28), transparent 55%);
}

.welcome-hero__content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  text-align: left;
  color: #fff;
  animation: auth-rise 0.85s var(--ease) both;
}

.welcome-hero__eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.welcome-hero__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.welcome-hero__title span {
  color: #ffb4ae;
}

.welcome-hero__lead {
  margin: 0 0 1.75rem;
  max-width: 42ch;
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
}

.welcome-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.welcome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.35rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.welcome-btn:hover {
  transform: translateY(-1px);
}

.welcome-btn--primary {
  background: var(--bimar-red);
  color: #fff;
}

.welcome-btn--primary:hover {
  background: var(--bimar-red-deep);
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-ken {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.1) translate3d(-1.5%, -1%, 0);
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 38vh;
    align-items: flex-end;
  }

  .auth-brand__title {
    font-size: clamp(1.8rem, 7vw, 2.4rem);
  }

  .auth-brand__lead {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding-top: 2rem;
    min-height: 62vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand__media,
  .auth-brand__content,
  .auth-panel__inner,
  .welcome-hero__content {
    animation: none;
  }
}
