/* Auth pages (login, register): single-column card layout.
   Loads after kairableu.css — uses !important where kairableu sets global form !important. */

html {
  height: auto;
  min-height: 100%;
}

body.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f1f5f9;
  touch-action: manipulation;
}

.auth-page-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1.25rem max(1.5rem, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.auth-page-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(43, 113, 225, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 113, 225, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.auth-page-brand {
  display: inline-block;
}

.auth-page-brand img {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 0;
}

/* Logo inside auth card (login + register) */
.auth-form-card-logo {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-form-card-logo .auth-page-brand {
  display: inline-block;
}

.auth-page-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.75rem 0 1rem;
}

.auth-page-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 1.25rem;
  width: 100%;
  max-width: 28rem;
  text-align: center;
}

.auth-page-copyright {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: #64748b;
  text-transform: uppercase;
}

.btn-primary {
  background-color: #2b71e1 !important;
  color: #ffffff !important;
  font-weight: 800;
  border-radius: 999px;
  letter-spacing: 0.02em;
  min-height: 48px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background-color: #70b5fa !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(43, 113, 225, 0.35);
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  outline: 2px solid #2b71e1;
  outline-offset: 3px;
}

.auth-form-card {
  position: relative;
  width: 100%;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 28px rgba(43, 113, 225, 0.07),
    0 20px 56px rgba(15, 23, 42, 0.06);
  padding: 1.75rem 1.5rem 1.75rem;
}

@media (min-width: 769px) {
  .auth-form-card {
    padding: 2rem 1.75rem 2rem;
    border-radius: 22px;
  }
}

.auth-page-register .auth-form-card {
  background: linear-gradient(165deg, #ffffff 0%, #f8fbff 55%, #ffffff 100%);
  border-color: rgba(43, 113, 225, 0.14);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 36px rgba(43, 113, 225, 0.1),
    0 24px 64px rgba(15, 23, 42, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .auth-form-card {
    box-shadow:
      0 1px 3px rgba(15, 23, 42, 0.08),
      0 8px 24px rgba(15, 23, 42, 0.06);
  }
  .btn-primary:hover {
    transform: none;
  }
}

.login-eyebrow-right {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #2b71e1;
  margin-bottom: 6px;
}

.login-title-right {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.06em;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #2b71e1 0%, #3b82f6 45%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-sub-right {
  font-size: 14px;
  color: #666;
  margin-bottom: 18px;
  line-height: 1.55;
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

input.login-input,
select.login-input,
textarea.login-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px !important;
  border: 1.5px solid #f0e4d8 !important;
  padding: 12px 14px !important;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a !important;
  background: #fdf8f5 !important;
  outline: none;
  min-height: 48px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

textarea.login-input {
  min-height: 96px;
  resize: vertical;
}

input.login-input:focus,
select.login-input:focus,
textarea.login-input:focus {
  border-color: #2b71e1 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 1px rgba(43, 113, 225, 0.25) !important;
}

.auth-page-register input.login-input,
.auth-page-register select.login-input,
.auth-page-register textarea.login-input {
  background: #e8f2fe !important;
  border-color: rgba(43, 113, 225, 0.28) !important;
}

.auth-page-register input.login-input:focus,
.auth-page-register select.login-input:focus,
.auth-page-register textarea.login-input:focus {
  background: #ffffff !important;
  border-color: #2b71e1 !important;
  box-shadow: 0 0 0 3px rgba(43, 113, 225, 0.18) !important;
}

.login-forgot-link {
  font-size: 12px;
  font-weight: 700;
  color: #2b71e1;
  text-decoration: none;
}

.login-forgot-link:hover {
  text-decoration: underline;
  color: #70b5fa;
}

.login-helper {
  margin-top: 14px;
  font-size: 13px;
  color: #666;
  text-align: center;
  line-height: 1.5;
}

.login-helper a {
  color: #2b71e1;
  font-weight: 700;
  text-decoration: none;
}

.login-helper a:hover {
  text-decoration: underline;
  color: #70b5fa;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .auth-form-grid {
    grid-template-columns: 1fr;
  }
}

.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
}

.auth-consent input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #2b71e1;
  cursor: pointer;
}

.auth-consent label {
  cursor: pointer;
  font-weight: 500;
}

.auth-consent a {
  color: #2b71e1;
  font-weight: 700;
  text-decoration: none;
}

.auth-consent a:hover {
  text-decoration: underline;
  color: #70b5fa;
}

.auth-alert {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.auth-alert--error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.auth-skip {
  position: absolute;
  left: -9999px;
  z-index: 1000;
  padding: 8px 16px;
  background: #2b71e1;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
}

.auth-skip:focus {
  left: 16px;
  top: 16px;
}
