/* ============================================================
   LOGIN PAGE
   ============================================================ */

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

body.auth-body {
  font-family: var(--font-primary);
  background: var(--white);
  height: 100vh;
  overflow: hidden;
}

/* ── Split layout ─────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  height: 100vh;
}

.auth-image {
  width: 50%;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: linear-gradient(135deg, var(--deep-space) 0%, var(--sidebar-hover) 50%, var(--deep-space) 100%);
}

.auth-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  padding: 48px 40px;
  overflow-y: auto;
}

/* ── Form container ───────────────────────────────────────── */
.auth-form-container {
  width: 100%;
  max-width: 380px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.auth-logo {
  height: 42px;
  display: block;
}

.auth-brand-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gray-400);
  text-transform: uppercase;
}

.auth-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--deep-space);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Inputs ───────────────────────────────────────────────── */
.auth-form .form-group {
  margin-bottom: 14px;
}

.auth-form .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.auth-form .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 230, 230, 0.12);
}

.auth-form .form-control::placeholder {
  color: var(--gray-400);
}

/* ── Options row ──────────────────────────────────────────── */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* ── Toggle switch ────────────────────────────────────────── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 38px;
  height: 22px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--white);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.toggle-input:checked + .toggle-switch {
  background: var(--primary);
}

.toggle-input:checked + .toggle-switch::after {
  transform: translateX(16px);
}

.toggle-text {
  font-size: 14px;
  color: var(--gray-700);
}

/* ── Links ────────────────────────────────────────────────── */
.auth-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-link:hover {
  color: var(--primary-dark);
}

/* ── Sign in button ───────────────────────────────────────── */
.btn-signin {
  width: 100%;
  padding: 13px 24px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
  margin-bottom: 28px;
}

.btn-signin:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(20, 230, 230, 0.35);
}

.btn-signin:active {
  transform: scale(0.99);
  box-shadow: none;
}

/* ── Footer ───────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--gray-500);
}

/* ── Error alert ──────────────────────────────────────────── */
.auth-error {
  background: var(--danger-bg);
  border: 1px solid #FECACA;
  color: #B91C1C;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  body.auth-body {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  /* Skryj tmavou levou část — !important přebíjí případné inline styly */
  .auth-image { display: none !important; }

  .auth-wrapper {
    height: 100dvh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
  }

  .auth-panel {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
    min-height: 100dvh;
  }

  .auth-form-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Větší logo + název na mobilu */
  .auth-brand {
    margin-bottom: 36px;
    gap: 14px;
  }

  .auth-brand img {
    width: 72px !important;
    height: 72px !important;
  }

  .auth-brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gray-700);
  }

  /* Formulář na plnou šířku */
  .auth-title {
    font-size: 22px;
    text-align: center;
    width: 100%;
  }

  .auth-subtitle {
    text-align: center;
    width: 100%;
  }

  .auth-form {
    width: 100%;
  }

  .auth-form .form-control {
    font-size: 16px; /* zabraňuje iOS auto-zoom */
    min-height: 48px;
    padding: 14px 16px;
  }

  .auth-options {
    width: 100%;
  }

  .btn-signin {
    min-height: 48px;
    font-size: 15px;
  }

  .auth-footer {
    width: 100%;
    margin-top: 4px;
  }
}
