:root {
  --page-bg: #f4f4f4;
  --card-bg: #ffffff;
  --text-main: #222222;
  --text-muted: #6f664c;
  --accent: #8f805d;
  --accent-hover: #756746;
  --border: #c8bea5;
  --error-bg: #fff1f2;
  --error-text: #991b1b;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(181, 143, 58, 0.16), transparent 32rem),
    var(--page-bg);
}

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

.login-card {
  width: min(100%, 420px);
  padding: 36px;
  background: var(--card-bg);
  border: 1px solid rgba(200, 190, 165, 0.85);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #8f805d;
  overflow: hidden;
}

.login-logo img {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.login-brand p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.login-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 14px;
}

.login-message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid rgba(143, 128, 93, 0.30);
  background: rgba(239, 231, 210, 0.75);
  color: #4a432f;
}

.login-message.error {
  border-color: rgba(153, 27, 27, 0.28);
  background: var(--error-bg);
  color: var(--error-text);
}

.login-message--compact {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 650;
}

.login-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(181, 143, 58, 0.18);
}

.login-form button {
  height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(to bottom, #efe7d2, #d8c59a);
  border: 1px solid #8f805d;
  color: #2b261c;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.login-form button:hover {
  background: linear-gradient(to bottom, #f7f1e3, #cdb77f);
}

.login-form button:active {
  transform: translateY(1px);
}

.login-form button:disabled {
  background: #ded8ca;
  border-color: #b6ad96;
  color: #7c7462;
  opacity: 0.85;
  cursor: wait;
}


.login-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.new-user-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #8f805d;
  border-radius: 10px;
  color: #4a432f;
  background: #fffaf0;
  font-weight: 750;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.new-user-button:hover {
  background: rgba(181, 143, 58, 0.12);
}

.new-user-button:active {
  transform: translateY(1px);
}

.login-secondary-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.login-secondary-link:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .login-card {
    padding: 26px;
    border-radius: 18px;
  }
}

.login-card-actions--compact {
  margin-top: 10px;
}

.login-debug-link {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(143, 128, 93, 0.48);
  background: rgba(239, 231, 210, 0.62);
  color: #4a432f;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.login-debug-link strong {
  display: block;
  margin-bottom: 5px;
}

.login-debug-link a {
  color: var(--accent);
  font-weight: 650;
}

/* Chromium / Edge autofill: potlaci vychozi svetle modre podbarveni. */
.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #f7f1e3 inset !important;
  -webkit-text-fill-color: #2b261c !important;
  caret-color: #2b261c;
  border-color: var(--border);
}


.form-help {
  display: block;
  margin-top: -2px;
  color: #6f664c;
  font-size: 13px;
  line-height: 1.35;
}

.password-help.is-warning {
  color: #6f664c;
  font-weight: 700;
}

.password-help.is-valid {
  color: #4f6647;
  font-weight: 700;
}
