:root {
  --ap-font: "Manrope", system-ui, sans-serif;
  --ap-ink: #102f54;
  --ap-muted: #5a6b7a;
  --ap-card: rgba(255, 255, 255, 0.94);
  --ap-border: rgba(16, 47, 84, 0.1);
  --ap-accent: #26aba3;
  --ap-accent-2: #1e8a84;
  --ap-glow: rgba(38, 171, 163, 0.35);
  --ap-chip-bg: rgba(255, 255, 255, 0.14);
  --ap-chip-fg: #fff;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

.auth-portal {
  min-height: 100vh;
  font-family: var(--ap-font);
  color: var(--ap-ink);
  position: relative;
  overflow: hidden;
  background: #0b1f38;
}

/* —— ADMIN: tmavá navy + jantár —— */
.auth-portal--admin {
  --ap-accent: #f5a313;
  --ap-accent-2: #ffc14d;
  --ap-glow: rgba(245, 163, 19, 0.38);
  --ap-chip-bg: rgba(245, 163, 19, 0.18);
  --ap-chip-fg: #ffd991;
  background: #0a1220;
}

.auth-portal--admin .auth-aurora {
  background:
    radial-gradient(ellipse 48% 42% at 18% 28%, rgba(245, 163, 19, 0.28), transparent 55%),
    radial-gradient(ellipse 40% 45% at 82% 18%, rgba(56, 90, 140, 0.35), transparent 50%),
    radial-gradient(ellipse 55% 40% at 55% 95%, rgba(8, 16, 30, 0.95), transparent 60%),
    linear-gradient(150deg, #070d18 0%, #121c2e 45%, #0a1424 100%);
}

.auth-portal--admin .auth-orb--a {
  background: radial-gradient(circle, rgba(245, 163, 19, 0.55) 0%, transparent 68%);
}

.auth-portal--admin .auth-orb--b {
  background: radial-gradient(circle, rgba(90, 130, 190, 0.4) 0%, transparent 70%);
}

.auth-portal--admin .auth-portal-eyebrow {
  color: #c4840c;
}

.auth-portal--admin .auth-portal-submit {
  background: linear-gradient(135deg, #f5a313, #d98908);
  color: #1a1206;
}

.auth-portal--admin .auth-portal-form input:focus {
  border-color: #f5a313;
  box-shadow: 0 0 0 4px rgba(245, 163, 19, 0.18);
}

/* —— EXPERT: hlboký teal / klinický —— */
.auth-portal--expert {
  --ap-accent: #1aa39a;
  --ap-accent-2: #0d6e68;
  --ap-glow: rgba(26, 163, 154, 0.42);
  --ap-chip-bg: rgba(26, 163, 154, 0.2);
  --ap-chip-fg: #b8f0eb;
  background: #062428;
}

.auth-portal--expert .auth-aurora {
  background:
    radial-gradient(ellipse 55% 45% at 12% 38%, rgba(26, 163, 154, 0.5), transparent 55%),
    radial-gradient(ellipse 42% 40% at 88% 22%, rgba(8, 90, 86, 0.55), transparent 50%),
    radial-gradient(ellipse 50% 40% at 48% 100%, rgba(4, 28, 32, 0.9), transparent 55%),
    linear-gradient(160deg, #041a1e 0%, #0a353a 48%, #062830 100%);
}

.auth-portal--expert .auth-orb--b {
  background: radial-gradient(circle, rgba(180, 240, 230, 0.28) 0%, transparent 70%);
}

.auth-portal--expert .auth-portal-eyebrow {
  color: #0f7a74;
}

.auth-portal--expert .auth-portal-submit {
  background: linear-gradient(135deg, #1aa39a, #0d6e68);
}

.auth-portal--expert .auth-portal-form input:focus {
  border-color: #1aa39a;
  box-shadow: 0 0 0 4px rgba(26, 163, 154, 0.18);
}

.auth-portal--expert .auth-portal-forgot {
  color: #0d6e68;
}

/* —— KLIENT: svetlá stránka ako homepage —— */
.auth-portal--klient {
  --ap-font: "Open Sans", system-ui, sans-serif;
  --ap-ink: #293039;
  --ap-muted: #51565d;
  --ap-accent: #26aba3;
  --ap-accent-2: #1e8a84;
  --ap-glow: rgba(38, 171, 163, 0.28);
  --ap-chip-bg: rgba(38, 171, 163, 0.12);
  --ap-chip-fg: #1e8a84;
  --ap-card: #ffffff;
  --ap-border: rgba(41, 48, 57, 0.08);
  background: #f4faf9;
  font-family: var(--ap-font);
}

.auth-portal--klient .auth-aurora {
  background:
    radial-gradient(ellipse 55% 45% at 15% 20%, rgba(38, 171, 163, 0.14), transparent 55%),
    radial-gradient(ellipse 45% 40% at 85% 75%, rgba(247, 171, 30, 0.12), transparent 50%),
    linear-gradient(160deg, #eef7f6 0%, #f8fcfb 45%, #e8f4f2 100%);
  animation: none;
}

.auth-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, var(--ap-glow), transparent 55%),
    radial-gradient(ellipse 45% 50% at 80% 20%, rgba(245, 163, 19, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 45% at 60% 90%, rgba(16, 47, 84, 0.9), transparent 60%),
    linear-gradient(145deg, #0b1f38 0%, #123a4f 42%, #0e2c40 100%);
  animation: auroraShift 18s ease-in-out infinite alternate;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.7;
  mix-blend-mode: screen;
  will-change: transform;
}

.auth-orb--a {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  left: -8%;
  top: 10%;
  background: radial-gradient(circle, var(--ap-accent) 0%, transparent 68%);
  animation: floatA 14s ease-in-out infinite;
}

.auth-orb--b {
  width: min(36vw, 360px);
  height: min(36vw, 360px);
  right: -6%;
  top: 35%;
  background: radial-gradient(circle, rgba(245, 163, 19, 0.55) 0%, transparent 70%);
  animation: floatB 17s ease-in-out infinite;
}

.auth-orb--c {
  width: min(28vw, 280px);
  height: min(28vw, 280px);
  left: 40%;
  bottom: -8%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 70%);
  animation: floatC 12s ease-in-out infinite;
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  animation: gridDrift 28s linear infinite;
}

.auth-ripple {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 120vmax;
  height: 120vmax;
  transform: translate(-50%, -50%);
  background: repeating-radial-gradient(
    circle at center,
    transparent 0,
    transparent 42px,
    rgba(255, 255, 255, 0.03) 43px,
    transparent 44px
  );
  animation: ripplePulse 22s ease-in-out infinite;
  opacity: 0.55;
}

.auth-leaf {
  position: absolute;
  z-index: 1;
  opacity: 0.55;
  pointer-events: none;
}

.auth-leaf img {
  display: block;
  width: min(28vw, 220px);
  height: auto;
}

.auth-leaf--tl {
  top: -2%;
  left: -2%;
  animation: leafSway 10s ease-in-out infinite;
}

.auth-leaf--br {
  right: -3%;
  bottom: -4%;
  opacity: 0.4;
  animation: leafSway 12s ease-in-out infinite reverse;
}

.auth-leaf--br img {
  width: min(34vw, 280px);
}

.auth-soft-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}

.auth-soft-blob--a {
  width: min(50vw, 420px);
  height: min(50vw, 420px);
  left: -10%;
  bottom: 10%;
  background: rgba(38, 171, 163, 0.22);
  animation: floatA 16s ease-in-out infinite;
}

.auth-soft-blob--b {
  width: min(40vw, 340px);
  height: min(40vw, 340px);
  right: -8%;
  top: 8%;
  background: rgba(247, 171, 30, 0.18);
  animation: floatB 18s ease-in-out infinite;
}

.auth-portal-main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.75rem;
  padding: 2rem 1.25rem 2.5rem;
}

.auth-portal-main--klient {
  gap: 1.25rem;
  padding: 1.5rem 1.25rem 2rem;
}

.auth-brand-mark {
  display: block;
  opacity: 0;
  transform: translateY(-12px);
  animation: riseIn 0.8s ease forwards 0.1s;
}

.auth-brand-mark img {
  display: block;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

.auth-brand-mark--light img {
  filter: none;
}

.auth-role-chip {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--ap-chip-bg);
  color: var(--ap-chip-fg);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-portal--admin .auth-role-chip,
.auth-portal--expert .auth-role-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-portal--klient .auth-role-chip {
  border: 1px solid rgba(38, 171, 163, 0.2);
}

.auth-portal-card {
  width: min(440px, 100%);
  background: var(--ap-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--ap-border);
  border-radius: 28px;
  padding: 2rem 1.75rem 1.5rem;
  box-shadow:
    0 24px 60px rgba(8, 24, 40, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  animation: riseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.22s;
}

.auth-portal--admin .auth-portal-card {
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(245, 163, 19, 0.12) inset;
}

.auth-portal--expert .auth-portal-card {
  box-shadow:
    0 24px 60px rgba(0, 20, 24, 0.35),
    0 0 0 1px rgba(26, 163, 154, 0.15) inset;
}

.auth-portal-eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ap-accent-2);
}

.auth-portal-card h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  line-height: 1.15;
  font-weight: 800;
  color: var(--ap-ink);
}

.auth-portal-lead {
  margin: 0.75rem 0 0;
  color: var(--ap-muted);
  line-height: 1.55;
  font-size: 0.98rem;
}

.auth-portal-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.auth-portal-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ap-ink);
}

.auth-portal-form input {
  width: 100%;
  border: 1px solid #d5e3e8;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
  background: #fff;
  color: var(--ap-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-portal-form input:focus {
  outline: none;
  border-color: var(--ap-accent);
  box-shadow: 0 0 0 4px rgba(38, 171, 163, 0.15);
}

.auth-portal-error {
  background: #fdecea;
  color: #b42318;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-portal-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.25rem;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  background: linear-gradient(135deg, var(--ap-accent), var(--ap-accent-2));
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px var(--ap-glow);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.auth-portal-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.auth-portal-submit:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.auth-portal-back {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--ap-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-portal-back:hover {
  color: var(--ap-accent-2);
}

.auth-portal-forgot {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: var(--ap-accent-2);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-portal-forgot:hover {
  text-decoration: underline;
}

.auth-portal-error.is-success {
  background: rgba(30, 125, 85, 0.12);
  color: #1e7d55;
  border-color: rgba(30, 125, 85, 0.25);
}

.auth-portal-error.is-notice {
  background: rgba(38, 171, 163, 0.12);
  color: #0f766e;
  border: 1px solid rgba(38, 171, 163, 0.22);
}

.auth-portal--admin .auth-portal-error.is-notice {
  background: rgba(245, 163, 19, 0.14);
  color: #8a5a00;
  border-color: rgba(245, 163, 19, 0.28);
}

.auth-portal-form input[readonly] {
  opacity: 0.92;
  cursor: default;
  background: rgba(255, 255, 255, 0.55);
}

/* —— Klient shell (split layout) —— */
.auth-klient-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: #fff;
  border: 1px solid rgba(41, 48, 57, 0.08);
  border-radius: 32px;
  overflow: hidden;
  box-shadow:
    0 28px 70px rgba(41, 48, 57, 0.1),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  opacity: 0;
  transform: translateY(20px);
  animation: riseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.18s;
}

.auth-klient-visual {
  position: relative;
  min-height: 520px;
  background: #e8f4f2;
  display: grid;
  align-content: end;
}

.auth-klient-visual__media {
  position: absolute;
  inset: 0;
}

.auth-klient-visual__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-klient-visual__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(41, 48, 57, 0.05) 0%, rgba(41, 48, 57, 0.55) 100%),
    linear-gradient(90deg, rgba(38, 171, 163, 0.18), transparent 55%);
}

.auth-klient-visual__copy {
  position: relative;
  z-index: 1;
  padding: 2rem 1.75rem 1.85rem;
  color: #fff;
}

.auth-klient-visual__copy .auth-portal-eyebrow {
  color: #f7d28a;
  margin-bottom: 0.5rem;
}

.auth-klient-visual__copy h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
}

.auth-klient-visual__copy > p {
  margin: 0.65rem 0 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
  font-size: 0.95rem;
}

.auth-klient-points {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.auth-klient-points li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.auth-klient-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #f7ab1e;
  box-shadow: 0 0 0 3px rgba(247, 171, 30, 0.25);
}

.auth-portal-card--klient {
  width: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 2.1rem 1.85rem 1.75rem;
  opacity: 1;
  transform: none;
  animation: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-portal--klient .auth-portal-submit {
  background: #26aba3;
  box-shadow: 0 12px 28px rgba(38, 171, 163, 0.28);
}

.auth-portal--klient .auth-portal-submit:hover {
  filter: brightness(1.05);
}

.auth-klient-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1.35rem;
}

.auth-klient-links .auth-portal-forgot {
  margin-top: 0;
  text-align: left;
  color: var(--ap-accent-2);
}

.auth-portal-card--klient > .auth-portal-back {
  margin-top: 1rem;
}

.auth-klient-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(247, 171, 30, 0.14);
  color: #b57a0c;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-klient-cta:hover {
  background: rgba(247, 171, 30, 0.22);
  color: #8a5a00;
}

@keyframes auroraShift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.08) translate(-2%, 2%); }
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(8%, 12%); }
}

@keyframes floatB {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-10%, -8%); }
}

@keyframes floatC {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6%, -10%) scale(1.08); }
}

@keyframes gridDrift {
  from { transform: translateY(0); }
  to { transform: translateY(48px); }
}

@keyframes ripplePulse {
  0%, 100% { opacity: 0.35; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.02); }
}

@keyframes leafSway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(6px); }
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 860px) {
  .auth-klient-shell {
    grid-template-columns: 1fr;
  }

  .auth-klient-visual {
    min-height: 240px;
  }

  .auth-klient-visual__copy h2 {
    font-size: 1.45rem;
  }

  .auth-klient-points {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-portal-card {
    padding: 1.6rem 1.25rem 1.25rem;
    border-radius: 22px;
  }

  .auth-portal-card--klient {
    padding: 1.5rem 1.25rem 1.35rem;
  }

  .auth-brand-mark img {
    width: 180px;
  }

  .auth-klient-shell {
    border-radius: 24px;
  }

  .auth-leaf--tl,
  .auth-leaf--br {
    opacity: 0.28;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-aurora,
  .auth-orb,
  .auth-grid,
  .auth-ripple,
  .auth-leaf,
  .auth-soft-blob,
  .auth-brand-mark,
  .auth-portal-card,
  .auth-klient-shell {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
