:root {
  --blue: #0b4f9c;
  --blue-dark: #083d79;
  --orange: #f5a623;
  --background: #eef2f5;
  --surface: #ffffff;
  --text: #25313c;
  --muted: #657380;
  --border: #d8e0e7;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --success: #16703c;
  --success-bg: #eefbf3;
  --shadow: 0 22px 60px rgba(19, 45, 74, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-panel {
  width: min(100%, 520px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.auth-header {
  text-align: center;
}

.system-name {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  line-height: 1.16;
}

.orange-rule {
  width: 100%;
  height: 3px;
  margin: 24px 0 26px;
  background: var(--orange);
  border-radius: 999px;
}

.section-title {
  margin-bottom: 22px;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}

.section-title span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-title span::before {
  content: "";
  width: 8px;
  height: 22px;
  background: var(--orange);
  border-radius: 999px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--blue-dark);
  font-size: 0.94rem;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: #708090;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(11, 79, 156, 0.12);
  transform: translateY(-1px);
}

.input-wrap svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-left: 15px;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 14px;
  color: var(--text);
  font: inherit;
  font-weight: 500;
}

input::placeholder {
  color: #98a5af;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #edf5ff;
  outline: 0;
}

.icon-button svg {
  margin: 0;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -4px;
  font-size: 0.92rem;
}

.form-actions a {
  display: inline-flex;
  align-items: center;
}

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border: 0;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: var(--blue-dark);
  box-shadow: 0 12px 24px rgba(11, 79, 156, 0.2);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.82;
  transform: none;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.primary-button.is-loading .spinner {
  display: inline-block;
}

.message {
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid;
  border-radius: 7px;
  font-weight: 700;
  line-height: 1.45;
}

.message.error {
  border-color: #fac5c0;
  background: var(--danger-bg);
  color: var(--danger);
}

.message.success {
  border-color: #b9e8c9;
  background: var(--success-bg);
  color: var(--success);
}

.message.info {
  border-color: #f3d7a3;
  background: #fff8e8;
  color: #975b00;
}

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