:root {
  color-scheme: light;
  --bg: #e6edf7;
  --surface: #ffffff;
  --surface-strong: #f7faff;
  --border: #d9e2ec;
  --text: #12263f;
  --text-muted: #52606d;
  --accent: #0f4c81;
  --accent-soft: rgba(15, 76, 129, 0.12);
  --error: #c92a2a;
  --shadow: 0 24px 80px rgba(15, 38, 63, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top left, rgba(15, 76, 129, 0.15), transparent 22%),
              linear-gradient(180deg, #f8fbff 0%, #e6edf7 100%);
  color: var(--text);
}

body.fade-in {
  animation: fadeInPage 0.7s ease both;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand-copy span {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 1.95rem;
  line-height: 1.1;
}

.login-card p {
  margin: 0 0 30px;
  color: var(--text-muted);
  line-height: 1.6;
}

.field-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-strong);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.field-note {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

button.btn-primary {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f4c81, #1e5da1);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(15, 76, 129, 0.18);
}

button.btn-primary:disabled {
  opacity: 0.75;
  cursor: wait;
}

.button-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  margin-left: 10px;
  animation: spinner 0.75s linear infinite;
}

button.loading .button-loader {
  display: inline-block;
}

button.loading .button-text {
  opacity: 0.4;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

.error-message {
  min-height: 24px;
  margin: 16px 0 4px;
  color: var(--error);
  font-size: 0.96rem;
}

.login-footer {
  margin: 28px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

@media (max-width: 520px) {
  .login-card {
    padding: 28px 20px;
  }
}
