@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;1,500&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --font-display: "IBM Plex Serif", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;

  --paper: #f5f4f0;
  --surface: #ffffff;
  --ink: #232b3a;
  --ink-soft: #5b6472;
  --ink-faint: #686f7b;
  --line: #e3e0d8;
  --line-strong: #cfcbc0;

  --navy-900: #0f1a30;
  --navy-800: #16243f;
  --navy-700: #1e3a5f;
  --navy-600: #2a4a75;
  --brass: #a98b44;
  --brass-ink: #84682c;

  --success: #2b7354;
  --success-bg: #eaf4ef;
  --success-line: #cfe4d9;
  --danger: #a03b37;
  --danger-bg: #fbefee;
  --danger-line: #efd3d1;
  --warning: #8a661f;
  --warning-bg: #fbf3e3;
  --warning-line: #e8d9ae;
  --info: #2a4a75;
  --info-bg: #ecf0f6;
  --info-line: #d2dbe8;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(28, 37, 54, 0.06);
  --shadow-md:
    0 1px 2px rgba(28, 37, 54, 0.05), 0 10px 28px rgba(28, 37, 54, 0.09);
  --ring: 0 0 0 3px rgba(30, 58, 95, 0.16);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

* {
  margin: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--navy-700);
  color: #fff;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

a {
  color: var(--navy-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s var(--ease);
}

a:hover {
  border-bottom-color: currentColor;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

a:focus-visible {
  border-radius: var(--radius-sm);
}

button {
  font: inherit;
  cursor: pointer;
}

.btn,
#login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-md);
  background: var(--navy-700);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition:
    background 0.18s var(--ease),
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.btn:hover,
#login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(30, 58, 95, 0.34);
}

.btn:active,
#login-button:active {
  transform: translateY(1px);
}

#login-button {
  min-height: 50px;
  font-size: 16px;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-700));
  box-shadow: 0 6px 16px rgba(30, 58, 95, 0.28);
}

.btn[disabled],
#login-button[disabled] {
  opacity: 0.65;
  cursor: progress;
}

.btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

#login-button[disabled]::after {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-outline {
  background: transparent;
  color: var(--navy-700);
}

.btn-outline:hover {
  background: rgba(30, 58, 95, 0.06);
  color: var(--navy-700);
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fcfbf9;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  transition:
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    background 0.15s var(--ease);
  caret-color: var(--navy-700);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b9b4a6;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  background: #fff;
  border-color: var(--navy-700);
  box-shadow: var(--ring);
  border-radius: var(--radius-md);
}

input:user-invalid,
select:user-invalid,
textarea:user-invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.field {
  margin-bottom: 18px;
}

.hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.input-group {
  position: relative;
}

.input-group input {
  padding-right: 48px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  padding: 7px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  transition:
    color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.input-action:hover {
  color: var(--navy-700);
  background: rgba(30, 58, 95, 0.07);
}

.error {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.45;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--danger);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-navy {
  background: rgba(30, 58, 95, 0.09);
  color: var(--navy-700);
  border-color: rgba(30, 58, 95, 0.22);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: #b7d9c8;
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-line);
}

.badge-warn {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-line);
}

.badge-quiet {
  background: var(--paper);
  color: var(--ink-faint);
  border-color: var(--line);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-container {
  display: grid;
  grid-template-columns: minmax(420px, 5fr) 7fr;
  min-height: 100vh;
}

.brand-slideshow {
  position: absolute;
  inset: 0;
}

.brand-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.brand-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    rgba(22, 36, 63, 0.88),
    rgba(15, 26, 48, 0.93)
  );
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  background: linear-gradient(165deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: #e9ecf4;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 31px,
      rgba(255, 255, 255, 0.035) 31px 32px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 31px,
      rgba(255, 255, 255, 0.025) 31px 32px
    );
  pointer-events: none;
}

.auth-brand::after {
  content: "\20B1";
  position: absolute;
  right: -60px;
  bottom: -140px;
  font-family: var(--font-display);
  font-size: 30rem;
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  user-select: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, var(--brass), #8c7136);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--navy-900);
}

.brand-img {
  flex: none;
  height: 34px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.brand-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #f2f0e9;
}

.brand-name em {
  font-style: normal;
  color: var(--brass);
}

.brand-hero {
  position: relative;
  z-index: 1;
  max-width: 26ch;
}

.brand-hero h2 {
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 500;
  color: #f5f3ec;
  margin-bottom: 14px;
}

.brand-hero h2 em {
  font-style: italic;
  color: var(--brass);
}

.brand-hero p {
  font-size: 15.5px;
  color: #a9b2c5;
  max-width: 38ch;
}

.brand-points {
  position: relative;
  z-index: 1;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.brand-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #c3cada;
}

.brand-points li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 32px;
  background: #eeebe3;
  box-shadow: inset 28px 0 44px -34px rgba(15, 26, 48, 0.35);
}

#login-form {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

#login-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brass), #d9c284 55%, transparent);
}

#login-form h1 {
  font-size: 26px;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

#login-form label {
  margin-top: 16px;
}

#login-form label:first-of-type {
  margin-top: 0;
}

#error-message {
  margin-top: 16px;
}

#login-button {
  margin-top: 22px;
}

.auth-footer {
  margin-top: 28px;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

.auth-legal {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

.auth-legal a {
  color: var(--ink-soft);
  text-underline-offset: 2px;
}

.auth-legal a:hover {
  color: var(--navy-700);
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 24px;
}

.sk {
  display: block;
  border-radius: 5px;
  background: var(--line);
  background-image: linear-gradient(
    90deg,
    var(--line) 0%,
    var(--paper) 45%,
    var(--line) 90%
  );
  background-size: 220% 100%;
  animation: sk-sweep 1.25s ease-in-out infinite;
}

@keyframes sk-sweep {
  from {
    background-position: 130% 0;
  }
  to {
    background-position: -30% 0;
  }
}

.sk-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.sk-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.sk-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.sk-line {
  height: 10px;
  width: 100%;
  max-width: 190px;
}

.sk-line.short {
  height: 8px;
  max-width: 120px;
}

.sk-title {
  height: 22px;
  width: 260px;
  max-width: 100%;
}

.sk-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.sk-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.sk-block .sk-title {
  margin-bottom: 6px;
}

.sk-para {
  height: 11px;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sk {
    animation: none;
    background-image: none;
  }
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.rise {
  animation: rise 0.55s var(--ease) backwards;
}

.rise-1 {
  animation-delay: 0.05s;
}

.rise-2 {
  animation-delay: 0.14s;
}

.rise-3 {
  animation-delay: 0.23s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 880px) {
  .auth-mobile-brand {
    display: none;
    margin-bottom: 24px;
  }

  .login-container {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
    justify-content: center;
  }

  .auth-mobile-brand .brand-name {
    color: var(--ink);
  }

  .auth-mobile-brand .brand-name em {
    color: var(--brass-ink);
  }

  .auth-mobile-brand .brand-logo {
    color: var(--navy-900);
  }

  .auth-panel {
    padding: 40px 20px 28px;
  }

  #login-form {
    padding: 30px 24px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
  }

  .brand-slideshow img {
    animation: none !important;
  }

  .brand-slideshow img:first-child {
    opacity: 1 !important;
  }
}
