:root {
  --bg: #f5f1e8;
  --bg-soft: #f9f6f0;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.82);
  --text: #13222a;
  --muted: #607078;
  --primary: #bb4d00;
  --primary-strong: #8d3a00;
  --secondary: #0e6b68;
  --line: rgba(19, 34, 42, 0.12);
  --line-soft: rgba(19, 34, 42, 0.06);
  --shadow-sm: 0 10px 24px rgba(16, 38, 47, 0.08);
  --shadow-lg: 0 30px 80px rgba(16, 38, 47, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(187, 77, 0, 0.11), transparent 24%),
    radial-gradient(circle at bottom right, rgba(14, 107, 104, 0.13), transparent 28%),
    linear-gradient(180deg, #faf7f1 0%, #f2ece1 56%, #ebe3d7 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.34)),
    linear-gradient(90deg, rgba(19, 34, 42, 0.018) 1px, transparent 1px),
    linear-gradient(rgba(19, 34, 42, 0.018) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 72%);
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  padding: 22px;
  gap: 22px;
  position: relative;
  z-index: 1;
}

.login-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(24px, 3.8vw, 44px);
  box-shadow: var(--shadow-lg);
}

.login-panel-brand {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(16, 38, 47, 0.97), rgba(14, 107, 104, 0.9));
  color: #f7fbfb;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 24px;
  overflow: hidden;
  position: relative;
}

.login-page-admin .login-panel-brand {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(16, 38, 47, 0.97), rgba(121, 54, 10, 0.92));
}

.login-page-platform .login-panel-brand {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(16, 38, 47, 0.97), rgba(14, 107, 104, 0.92));
}

.login-page-platform .login-card {
  width: min(100%, 500px);
}

.login-panel-brand::after {
  content: '';
  position: absolute;
  inset: auto -10% -24% auto;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 68%);
}

.login-brandmark {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 16px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  position: relative;
  z-index: 1;
}

.login-brandmark-badge {
  width: 116px;
  height: 116px;
  flex: 0 0 116px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64), 0 10px 20px rgba(0, 0, 0, 0.08);
}

.login-brandmark-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.login-brandmark-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  line-height: 1;
  letter-spacing: 0.06em;
  color: #f7fbfb;
  white-space: nowrap;
}

.login-panel h1,
.login-card h2,
.modal-title {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
}

.login-panel h1 {
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
  max-width: 8ch;
  position: relative;
  z-index: 1;
}

.login-panel p,
.login-feature-list span {
  color: rgba(247, 251, 251, 0.78);
  line-height: 1.68;
  max-width: 52ch;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.72;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.login-feature-list {
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.login-feature-list article {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  display: grid;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-feature-list strong {
  font-size: 0.98rem;
}

.login-panel-form {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(10px);
}

.login-card {
  width: min(100%, 470px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.login-card h2 {
  font-size: 1.9rem;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.muted-copy,
.inline-note {
  color: var(--muted);
  line-height: 1.6;
}

.is-hidden {
  display: none !important;
}

.inline-note {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(19, 34, 42, 0.03);
  font-size: 0.92rem;
}

.inline-note a {
  color: inherit;
  font-weight: 700;
}

.inline-note-success {
  color: #0d5f5c;
  border-color: rgba(14, 107, 104, 0.18);
  background: rgba(14, 107, 104, 0.08);
}

.inline-note-warning {
  color: #8d3a00;
  border-color: rgba(187, 77, 0, 0.18);
  background: rgba(187, 77, 0, 0.08);
}

.inline-note-error {
  color: #8d2f2a;
  border-color: rgba(141, 47, 42, 0.18);
  background: rgba(141, 47, 42, 0.08);
}

.login-feature-list code,
.inline-note code {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(19, 34, 42, 0.08);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  padding: 12px;
  border: 1px solid rgba(19, 34, 42, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(19, 34, 42, 0.025), rgba(255, 255, 255, 0.56));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.login-form span {
  font-size: 0.9rem;
  color: var(--text);
}

.login-form input,
.form-control {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(19, 34, 42, 0.12);
  background: #fff;
  color: var(--text);
  caret-color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease;
}

.login-form input::placeholder,
.form-control::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, white 18%);
}

.login-form input:hover,
.form-control:hover {
  border-color: rgba(19, 34, 42, 0.18);
}

.login-form input:focus,
.form-control:focus {
  outline: none;
  border-color: rgba(187, 77, 0, 0.34);
  box-shadow: 0 0 0 4px rgba(187, 77, 0, 0.1);
}

.login-form input:disabled,
.login-form input[readonly],
.form-control:disabled,
.form-control[readonly] {
  cursor: not-allowed;
  color: var(--muted);
  background: rgba(19, 34, 42, 0.05);
  border-color: rgba(19, 34, 42, 0.08);
  box-shadow: none;
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus,
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 5000s ease-in-out 0s;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(187, 77, 0, 0.18);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  transform: translateY(-1px);
}

.secondary-button {
  background: rgba(19, 34, 42, 0.05);
  border-color: rgba(19, 34, 42, 0.08);
  color: var(--text);
}

.button-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  display: inline-block;
  animation: spin 700ms linear infinite;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 19, 24, 0.48);
  backdrop-filter: blur(8px);
  z-index: 9999;
}

.modal-backdrop.is-hidden {
  display: none;
}

.modal-card {
  width: min(100%, 620px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-body,
.modal-actions {
  padding: 20px 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}

.modal-title {
  font-size: 1.16rem;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(19, 34, 42, 0.08);
  background: rgba(19, 34, 42, 0.05);
}

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 920px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-panel h1 {
    max-width: 12ch;
  }
}

@media (max-width: 640px) {
  .login-layout {
    padding: 14px;
    gap: 14px;
  }

  .login-panel,
  .login-card {
    padding: 22px;
    border-radius: 22px;
  }

  .login-brandmark {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
  }

  .login-brandmark-badge {
    width: 92px;
    height: 92px;
    flex-basis: 92px;
  }

  .login-brandmark-text {
    font-size: 1rem;
    white-space: normal;
  }
}
