:root {
  --ink: #2B1D14;
  --muted: #8C7769;
  --forest: #C4693B;
  --sage: #FAF0E6;
  --marigold: #DE9F45;
  --line: #E0CFBF;
  --danger: #C4693B;
  --success: #2E8F87;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background: #FCFAF7;
}

button, input { font: inherit; }

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.auth-card {
  display: grid;
  align-content: center;
  width: min(100%, 24rem);
  min-height: 26rem;
  border: 1px solid #E8D5C8;
  border-radius: 1.5rem;
  background: #FEFCF9;
  box-shadow: 0 20px 60px rgba(60, 35, 20, 0.08);
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
}

.auth-brand {
  margin-bottom: 0.7rem;
  color: #2B1D14;
  font-weight: 950;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth-form { display: none; }
.auth-form.active { display: grid; gap: 0.8rem; }

h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 2rem;
  color: #2B1D14;
}

label {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

input {
  width: 100%;
  border: 1px solid #E0CFBF;
  border-radius: 1rem;
  background: #FEFCF9;
  color: #2B1D14;
  padding: 0.88rem 1rem;
}

input:focus {
  outline: none;
  border-color: #C4693B;
  box-shadow: 0 0 0 3px rgba(196, 105, 59, 0.2);
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid #E0CFBF;
  border-radius: 1rem;
  background: #FEFCF9;
}

.password-field:focus-within {
  border-color: #C4693B;
  box-shadow: 0 0 0 3px rgba(196, 105, 59, 0.2);
}

.password-field input { border: 0; background: transparent; }
.password-field input:focus { box-shadow: none; }

.ghost-icon, .link-button {
  border: 0;
  background: transparent;
  color: #C4693B;
  cursor: pointer;
  font-weight: 900;
}

.ghost-icon:hover, .link-button:hover {
  color: #B25A2E;
}

.link-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost-icon { padding: 0.6rem 0.85rem; font-size: 0.78rem; }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-row.align-end {
  justify-content: flex-end;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.96rem;
}

.check-row input { width: auto; }

.primary-button, .secondary-button {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  cursor: pointer;
  font-weight: 600;
}

.primary-button {
  color: #FFFFFF;
  background: #C4693B;
  box-shadow: 0 10px 24px rgba(196, 105, 59, 0.28);
}

.primary-button:hover {
  background: #B25A2E;
}

.secondary-button {
  color: #2B1D14;
  background: #FEFCF9;
  border: 1px solid #E8D5C8;
}

.secondary-button:hover {
  background: #F2E4D8;
}

.message {
  min-height: 1.25rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.message.error { color: var(--danger); }
.message.success { color: var(--success); }

.message.inactive-account {
  line-height: 1.4;
}

.message.inactive-account strong,
.message.inactive-account span {
  display: block;
}

.toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  bottom: auto;
  transform: none;
  display: grid;
  gap: 0.5rem;
  z-index: 1000;
  pointer-events: none;
}

.toast-message {
  min-width: 14rem;
  color: #fff;
  background: rgba(196, 105, 59, 0.96);
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: 0 20px 45px rgba(60, 35, 20, 0.18);
  opacity: 0;
  transform: translateY(0.75rem);
  animation: toastIn 220ms ease forwards;
  pointer-events: auto;
}

.toast-message.error {
  background: rgba(196, 105, 59, 0.96);
}

@keyframes toastIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.inactive-account strong {
  font-weight: 800;
}

.message.inactive-account span {
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.2rem;
}

@media (max-width: 560px) {
  .auth-shell { padding: 0.8rem; }
  .auth-row { align-items: flex-start; flex-direction: column; }
}


.auth-logo {
  display: block;
  width: 8.2rem;
  max-width: 100%;
  height: 2.75rem;
  object-fit: cover;
  object-position: center;
  margin-bottom: 0.25rem;
}

.auth-brand {
  display: grid;
  justify-items: start;
}

.app-version {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
}

.eye-button {
  display: grid;
  place-items: center;
}

.eye-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}


input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-caps-lock-indicator {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
}



/* Align recovery actions without changing the OTP request or resend flow. */
.otp-action-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
}

.otp-action-layout .primary-button {
  width: 100%;
}

.otp-side-actions {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.otp-side-actions .secondary-button {
  padding: 0.7rem 1.05rem;
}

.otp-side-actions .link-button {
  padding: 0.1rem 0;
  font-size: 0.78rem;
}

@media (max-width: 560px) {
  .otp-action-layout {
    grid-template-columns: 1fr;
  }

  .otp-side-actions {
    justify-items: stretch;
  }
}
.auth-card {
  position: relative;
}

.user-manual {
  position: absolute;
  top: 22px;
  right: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #C4693B;
  font-size: 25px;
  line-height: 1;
  text-decoration: none;

  cursor: pointer;
  z-index: 100;
}

.user-manual:hover {
  color: #B25A2E;
  transform: scale(1.08);
}

.flow-video {
  position: absolute;
  top: 22px;
  right: 105px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #C4693B;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;

  cursor: pointer;
  z-index: 100;
}

.flow-video:hover {
  color: #B25A2E;
  transform: scale(1.08);
}

/* Keep the authentication views usable at every supported phone width. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.toast-message {
  min-width: 0;
  max-width: calc(100vw - 1.5rem);
  overflow-wrap: anywhere;
}

@media (max-width: 359px) {
  .auth-shell {
    min-height: 100dvh;
    padding: 0.5rem;
  }

  .auth-card {
    min-height: 0;
    border-radius: 1rem;
  }

  .user-manual {
    top: 1rem;
    right: 1rem;
  }

  .flow-video {
    top: 1rem;
    right: 4.5rem;
  }
}
