:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --navy: #06284c;
  --ink: #17243b;
  --muted: #647168;
  --line: #d8dfd2;
  --green: #3d7b21;
  --green-hover: #32671b;
  --orange: #e87917;
  --background: #f5f6f2;
  --surface: #ffffff;
  --error: #b42318;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; color: var(--ink); background: var(--background); }
button, input, select { font: inherit; }

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

.login-card {
  width: min(430px, 100%);
  padding: 24px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(30, 53, 32, .08);
}

.login-card-toolbar {
  min-height: 40px;
  display: flex;
  justify-content: flex-end;
}

.login-language-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-language-control select {
  min-width: 104px;
  min-height: 40px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.brand-logo {
  width: min(260px, 78%);
  height: auto;
  display: block;
  margin: 8px auto 24px;
}

.login-heading { text-align: center; }
.login-heading h1 { margin: 0; color: var(--navy); font-size: 28px; line-height: 1.2; letter-spacing: 0; }
.login-heading p { margin: 8px 0 22px; color: var(--muted); font-size: 15px; line-height: 1.5; }

#admin-login-form { display: grid; gap: 8px; }
#admin-login-form > label { margin-top: 6px; color: #35483d; font-size: 13px; font-weight: 700; }
input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
}
input:hover { border-color: #b8c4b2; }
input:focus { border-color: var(--green); }
input:focus-visible, button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(61, 123, 33, .22);
  outline-offset: 2px;
}

.password-field { position: relative; }
.password-field input { padding-right: 72px; }
.password-field button {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 58px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.password-field button:hover { background: #eef6e9; }

.primary-action {
  min-height: 50px;
  margin-top: 12px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  cursor: pointer;
}
.primary-action:hover { background: var(--green-hover); }
.primary-action:disabled { opacity: .65; cursor: wait; }

.login-error {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #f5c5c0;
  border-radius: 12px;
  color: var(--error);
  background: #fff1f0;
  font-size: 13px;
  line-height: 1.45;
}

.field-user-link {
  min-height: 64px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 10px 12px;
  border: 1px solid #efd7c2;
  border-radius: 14px;
  color: var(--ink);
  background: #fff9f3;
  text-decoration: none;
}
.field-user-link:hover { border-color: var(--orange); background: #fff5eb; }
.field-user-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--orange);
}
.field-user-icon svg, .field-user-arrow {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.field-user-link strong, .field-user-link small { display: block; }
.field-user-link strong { font-size: 14px; }
.field-user-link small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.field-user-arrow { color: #8a725d; }

.privacy-note { margin: 16px 8px 0; color: #78847b; text-align: center; font-size: 11px; line-height: 1.45; }

html[dir="rtl"] .login-card-toolbar { justify-content: flex-start; }
html[dir="rtl"] .password-field input { padding-right: 14px; padding-left: 72px; }
html[dir="rtl"] .password-field button { right: auto; left: 5px; }
html[dir="rtl"] .field-user-arrow { transform: scaleX(-1); }

@media (max-width: 520px) {
  .login-page { align-items: start; padding: 16px 12px; }
  .login-card { padding: 18px 20px 22px; border-radius: 20px; }
  .brand-logo { width: min(238px, 78%); margin-top: 6px; margin-bottom: 20px; }
  .login-heading h1 { font-size: 25px; }
  .login-heading p { margin-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
