/* ===== Design tokens ===== */
:root {
  --bg-auth: #F7F4ED;
  --bg-app: #FFFFFF;
  --accent: #045A55;
  --text-primary: #242424;
  --text-secondary: #6B6B6B;
  --btn-text: #FFFFFF;
  --border-default: #E4E0D6;
  --border-error: #C0392B;
  --bg-error: #FDECEA;
  --bg-success: #E9F5EC;
  --radius: 8px;
  --font-display: "Cliffer Display", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-auth);
  min-height: 100vh;
}

/* ===== Top nav ===== */
.topnav {
  padding: 24px 64px;
}

.logo {
  height: 25px;
  display: block;
}

.logo-fallback {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.topnav-divider {
  height: 1px;
  background: var(--text-primary);
  width: 100%;
}

/* ===== Auth layout ===== */
.auth-layout {
  position: relative;
  min-height: calc(100vh - 74px);
  overflow: hidden;
}

.auth-illustration {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 46%;
  max-width: 620px;
  pointer-events: none;
  z-index: 0;
}

.auth-illustration img {
  width: 100%;
  height: auto;
  display: block;
}

.auth-form-wrap {
  position: relative;
  z-index: 1;
  max-width: 480px;
  padding: 76px 0 0 115px;
}

/* ===== Login heading ===== */
.login-heading {
  margin-bottom: 32px;
}

.login-heading h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text-primary);
  line-height: 1.2;
}

.supporting-text {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== Form fields ===== */
.field-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.field-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.field-group input {
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-app);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.field-group input::placeholder {
  font-size: 14px;
  color: var(--text-secondary);
}

.field-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(4, 90, 85, 0.12);
}

.field-group input.error {
  border-color: var(--border-error);
}

/* FIX: error text only takes up space when it actually has content */
.field-error {
  font-size: 12px;
  color: var(--border-error);
  margin-top: 0;
  display: none;
}

.field-error.visible {
  display: block;
  margin-top: 4px;
}

/* ===== Primary button ===== */
.btn-primary {
  width: 100%;
  height: 44px;
  background: var(--text-primary);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
  margin-top: 4px;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  opacity: 0.8;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Footer note ===== */
.footer-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 32px;
}

/* ===== Toasts ===== */
.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--text-primary);
  color: var(--btn-text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  animation: toast-in 0.2s ease-out;
}

.toast.success { background: #1A3A2E; }
.toast.error { background: #4A1F1B; }

.toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.toast-text {
  font-size: 13px;
  line-height: 1.4;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Restricted access toast ===== */
.restricted-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--text-primary);
  color: var(--btn-text);
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
  z-index: 900;
  animation: toast-in 0.25s ease-out;
}

.restricted-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.restricted-title {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 4px;
}

.restricted-desc {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.85);
}

.restricted-dismiss {
  background: rgba(255, 255, 255, 0.12);
  color: var(--btn-text);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.restricted-dismiss:hover {
  background: rgba(255, 255, 255, 0.2);
}

.restricted-toast.hidden {
  display: none;
}

/* ===== Desktop-only gate (replaces old shrink-to-fit responsive rules) ===== */
.mobile-gate {
  display: none;
}

@media (max-width: 768px) {
  .topnav,
  .topnav-divider,
  .auth-layout,
  .toast-stack,
  .restricted-toast {
    display: none;
  }

  .mobile-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: 40px 32px;
    background: var(--bg-auth);
  }

  .mobile-gate .logo-fallback {
    display: block;
    margin-bottom: 24px;
  }

  .mobile-gate h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-primary);
  }

  .mobile-gate p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0;
    line-height: 1.5;
  }
}