* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --border: #dbe3ee;
  --text: #17233a;
  --muted: #68758d;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #15803d;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-text: #b91c1c;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1d4ed8;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 34rem),
    radial-gradient(circle at bottom left, rgba(212, 175, 55, 0.16), transparent 30rem),
    var(--bg);
  color: var(--text);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.login-card {
  width: min(100%, 430px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  padding: 2rem;
}

.login-brand {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 1.8rem;
}

h1 {
  margin: 0;
  text-align: center;
  font-size: 1.35rem;
  line-height: 1.8;
}

.login-subtitle {
  margin: 0.35rem 0 1.35rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.9;
}

.login-message {
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--info-border);
  border-radius: 10px;
  background: var(--info-bg);
  color: var(--info-text);
  font-size: 0.86rem;
  line-height: 1.8;
  text-align: center;
  overflow-wrap: anywhere;
}

.login-message.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.login-message.error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

[hidden] {
  display: none !important;
}

form {
  display: grid;
  gap: 0.7rem;
}

label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #3e4a61;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.78rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

#adminCode {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.55rem;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary-button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.78rem 1rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-hover);
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.code-hint {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.9;
  text-align: center;
  overflow-wrap: anywhere;
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.15rem;
}

.text-button {
  border: 0;
  padding: 0.25rem;
  background: transparent;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.text-button:hover:not(:disabled) {
  color: var(--primary-hover);
  text-decoration: underline;
}

.resend-hint {
  min-height: 1.4rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.security-note {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.8;
  text-align: center;
}

.admin-version-login {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.7;
  text-align: center;
}
.admin-version-login span {
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 700;
}

@media (max-width: 520px) {
  .login-shell {
    padding: 0.75rem;
  }

  .login-card {
    padding: 1.35rem;
    border-radius: 16px;
  }

  h1 {
    font-size: 1.15rem;
  }
}
