/* The universal account card (pkg/publicaccount): one card for sign-in,
 * forgot, new-password, verification and account on every host, plus the
 * judge forms of pkg/eventapp/account that share its classes. The form
 * inside is the shared .nhc-form vocabulary (portal-forms.css, loaded first);
 * the rules below only shape it into the card (no required asterisks, the
 * trust box, one accent button).
 * Legacy design source: products/zasah frontend/src/pages/LoginPage.tsx,
 * Tailwind classes resolved to the portal token vocabulary.
 * Phone rules: copy stays in sentence case, every link and button is at
 * least 44px tall, and every field computes to 16px or more.
 * Host pages outside the portal shell link this file without the app bar
 * tokens.css and page.css, so every status colour carries its literal value
 * after the token and the card sizes its own .ui-icon. */
.portal-login { display: flex; flex: 1; justify-content: center; align-items: flex-start; padding: 2rem 1rem 3rem; }
@media (width>=48rem) { .portal-login { padding-top: 4rem; } }
.portal-login__card {
  width: 100%; max-width: 28rem; padding: 2rem; border-radius: 1rem;
  background: var(--portal-surface); border: 1px solid var(--portal-border);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
}
@media (width<30rem) {
  .portal-login { padding: 0 0 2rem; }
  .portal-login__card { padding: 1.75rem 1rem 2rem; border-radius: 0; border-inline: 0; box-shadow: none; }
}
.portal-login__card .ui-icon {
  width: 20px; height: 20px; flex: none; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.portal-login__head { display: flex; flex-direction: column; gap: .375rem; margin-bottom: 1.5rem; }
.portal-login__title { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--portal-text); }
.portal-login__intro { margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--portal-muted); }
.portal-login__form { display: flex; flex-direction: column; gap: 1.25rem; }
.portal-login__links { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; margin-top: 1rem; }
.portal-login__recovery, .portal-login__back-login, .portal-login__back-app, .portal-login__admin {
  display: inline-flex; align-items: center; box-sizing: border-box; min-height: 2.75rem;
  font-size: .9375rem; font-weight: 500; color: var(--portal-accent); text-decoration: underline; text-underline-offset: 3px;
}
.portal-login__recovery:hover, .portal-login__back-login:hover, .portal-login__back-app:hover, .portal-login__admin:hover { text-decoration-thickness: 2px; }
.portal-login__recovery:focus-visible, .portal-login__back-login:focus-visible, .portal-login__back-app:focus-visible, .portal-login__admin:focus-visible { outline: 2px solid var(--portal-accent); outline-offset: 2px; border-radius: 2px; }
.portal-login__card > .nhc-surface { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.portal-login__card > .nhc-surface > .nhc-surface__body { padding: 0; }
.portal-login__card .nhc-form__fields { gap: 1.125rem; }
.portal-login__card .nhc-form__label > span[aria-hidden="true"] { display: none; }
.portal-login__card .nhc-form__label { color: var(--portal-text); font-size: .875rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.portal-login__card .nhc-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  padding: .75rem 1rem; border-radius: .75rem; min-height: 3rem; font-size: max(16px, 1rem);
}
.portal-login__card .nhc-form label:has(> input[type="checkbox"]) {
  padding: .875rem 1rem; border-radius: .75rem; border: 1px solid var(--portal-border);
  background: color-mix(in srgb, var(--portal-surface-alt) 50%, transparent); cursor: pointer; transition: border-color .15s;
}
.portal-login__card .nhc-form label:has(> input[type="checkbox"]):hover { border-color: color-mix(in srgb, var(--portal-accent) 40%, transparent); }
.portal-login__card .nhc-form label:has(> input[type="checkbox"]) > span { font-size: .875rem; font-weight: 600; color: var(--portal-text); }
.portal-login__card .nhc-form label:has(> input[type="checkbox"]) [data-form-field-help] { grid-column: 2; }
.portal-login__card .nhc-form__actions { margin-top: .25rem; }
.portal-login__card .nhc-form__actions button {
  min-height: 2.75rem; font-size: .9375rem; letter-spacing: 0; text-transform: none; white-space: normal;
}
.portal-login__card .nhc-form__actions button[type="submit"] {
  width: 100%; padding: 1rem; border: 0; border-radius: .75rem; cursor: pointer;
  background: var(--portal-accent); color: var(--portal-accent-ink); font: inherit; font-size: .9375rem; font-weight: 600;
  box-shadow: 0 20px 25px -5px color-mix(in srgb, var(--portal-accent) 20%, transparent); transition: opacity .15s;
}
.portal-login__card .nhc-form__actions button[type="submit"]:hover { opacity: .9; }
.portal-login__modes {
  display: grid; grid-template-columns: 1fr 1fr; padding: .25rem; margin-bottom: -.25rem;
  border-radius: .75rem; border: 1px solid var(--portal-border); background: var(--portal-surface-alt);
}
.portal-login__mode-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.portal-login__mode {
  display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 2.75rem;
  text-align: center; padding: .5rem .75rem; border-radius: .5rem; cursor: pointer;
  font-size: .875rem; font-weight: 600; text-decoration: none;
  color: var(--portal-muted); transition: color .15s, background .15s;
}
.portal-login__mode:hover { color: var(--portal-accent); }
.portal-login__mode-input:checked + .portal-login__mode { background: var(--portal-accent); color: var(--portal-accent-ink); }
.portal-login__mode-input:focus-visible + .portal-login__mode { box-shadow: 0 0 0 2px color-mix(in srgb, var(--portal-accent) 40%, transparent); }
.portal-login__field { display: flex; flex-direction: column; gap: .5rem; }
.portal-login__label { display: block; font-size: .875rem; font-weight: 600; color: var(--portal-text); }
.portal-login__input {
  box-sizing: border-box; width: 100%; min-height: 3rem; padding: .75rem 1rem; border-radius: .75rem;
  font: inherit; font-size: max(16px, 1rem); font-weight: 400;
  color: var(--portal-text); background: var(--portal-bg-raised, var(--portal-surface-alt));
  border: 1px solid var(--portal-border); transition: border-color .15s, box-shadow .15s;
}
.portal-login__input::placeholder { color: color-mix(in srgb, var(--portal-subtle) 30%, transparent); }
.portal-login__input:focus { outline: none; border-color: var(--portal-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--portal-accent) 20%, transparent); }
/* Card messages: the icon sits beside the text, left-aligned. The card prints
 * every form error once with the warning icon (role=alert); a field-level
 * ui_htmx row keeps the same danger colours. */
.portal-login__notice, .portal-login__error {
  display: flex; align-items: flex-start; gap: .5rem; padding: .875rem 1rem; border-radius: .75rem; margin-bottom: 1.25rem;
}
.portal-login__notice p, .portal-login__error p { margin: 0; font-size: .875rem; line-height: 1.5; font-weight: 500; text-align: left; }
.portal-login__notice .ui-icon, .portal-login__error .ui-icon { margin-top: .0625rem; }
.portal-login__notice {
  color: var(--ui-status-info, #1d4f91); background: var(--ui-status-info-bg, #eef4fc);
  border: 1px solid var(--ui-info-line, #b9cfee);
}
.portal-login__error, .portal-login__card .nhc-form__validation > [role="alert"] {
  color: var(--ui-status-cancelled, #b3261e); background: var(--ui-status-cancelled-bg, #fdecee);
  border: 1px solid var(--ui-status-cancelled-line, #f1b3b0);
}
.portal-login__card .nhc-form__validation > [role="alert"] {
  margin-top: .375rem; padding: .5rem .75rem; border-radius: .5rem; font-size: .875rem; line-height: 1.4; font-weight: 500;
}
.portal-login__submit {
  display: flex; align-items: center; justify-content: center; gap: .5rem; box-sizing: border-box;
  width: 100%; min-height: 2.75rem; padding: 1rem; border: 0; border-radius: .75rem; cursor: pointer;
  background: var(--portal-accent); color: var(--portal-accent-ink); font: inherit; font-size: .9375rem; font-weight: 600;
  box-shadow: 0 20px 25px -5px color-mix(in srgb, var(--portal-accent) 20%, transparent); transition: opacity .15s;
}
.portal-login__submit:hover { opacity: .9; }
.portal-login__submit:disabled { opacity: .5; cursor: not-allowed; }
.portal-login__host-login { text-align: center; text-decoration: none; }
.portal-login__footer { display: flex; justify-content: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--portal-border); }
/* __caption stays for the judge forms (pkg/eventapp/account); the card itself no longer prints one. */
.portal-login__caption { margin: 0; font-size: .875rem; font-weight: 500; text-align: center; color: var(--portal-muted); }
.portal-login__privacy {
  display: inline-flex; align-items: center; box-sizing: border-box; min-height: 2.75rem;
  font-size: .875rem; font-weight: 500; color: var(--portal-accent); text-decoration: none;
}
.portal-login__privacy:hover { text-decoration: underline; }
/* Mode-bound fields: the register-only ones appear, and the login-only ones
 * vanish, while the "Registrácia" radio is checked. */
.portal-login .portal-login__register-only { display: none; }
.portal-login:has(#portal-login-mode-register:checked) .portal-login__field.portal-login__register-only { display: flex; }
.portal-login:has(#portal-login-mode-register:checked) .portal-login__submit .portal-login__register-only { display: inline; }
.portal-login:has(#portal-login-mode-register:checked) .portal-login__login-only { display: none; }
/* Password show/hide (js/password-reveal.js): the script wraps each password
 * input in a row with the translated button from the card's <template>. The
 * eye icon shows while the password is hidden, eye-off while it is shown. */
.portal-login__reveal-row { display: flex; align-items: stretch; gap: .5rem; }
.portal-login__card .portal-login__reveal-row > input { flex: 1 1 0; min-width: 0; width: auto; }
.portal-login__card .portal-login__reveal {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem; flex: none; box-sizing: border-box;
  min-height: 2.75rem; min-width: 2.75rem; padding: 0 .75rem; border-radius: .75rem; cursor: pointer;
  border: 1px solid var(--portal-border); background: var(--portal-surface); color: var(--portal-text);
  font: inherit; font-size: .875rem; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.portal-login__card .portal-login__reveal:hover { border-color: var(--portal-accent); color: var(--portal-accent); }
.portal-login__card .portal-login__reveal:focus-visible { outline: 2px solid var(--portal-accent); outline-offset: 2px; }
.portal-login__reveal[aria-pressed="true"] > .ui-icon:first-of-type,
.portal-login__reveal:not([aria-pressed="true"]) > .ui-icon:nth-of-type(2) { display: none; }
