/* ============= AUTH PAGES (login & register) ============= */

body.path-user .site-header,
body.path-user .site-footer,
body.user-login-page .site-header,
body.user-login-page .site-footer {
  display: none !important;
}

.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #eef4fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  max-width: 1100px;
  width: 100%;
  min-height: 640px;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.25), 0 12px 30px -10px rgba(15, 23, 42, 0.12);
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
}

/* ---- Brand panel (left) ---- */
.auth-brand {
  position: relative;
  background: linear-gradient(135deg, #1e3a8a 0%, #2d5494 50%, #598dd1 100%);
  color: #fff;
  padding: 3rem 2.75rem;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}
@media (max-width: 900px) {
  .auth-brand { padding: 2rem 1.5rem 2.5rem; }
}

.auth-brand::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  filter: blur(20px);
}
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -100px;
  width: 380px;
  height: 380px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  filter: blur(40px);
}

.auth-brand-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.auth-logo {
  display: inline-flex;
  margin-bottom: 2rem;
  background: #fff;
  padding: 0.5rem 0.875rem;
  border-radius: 14px;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.25);
  align-self: flex-start;
}
.auth-logo img {
  height: 44px;
  display: block;
}

.auth-brand h1 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 1rem;
  color: #fff;
}

.auth-brand-sub {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 2rem;
}

.auth-brand-list {
  list-style: none;
  padding: 0;
  margin: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.auth-brand-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
}
.auth-brand-list li svg {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  padding: 4px;
  color: #fff;
}

/* ---- Form panel (right) ---- */
.auth-form-wrap {
  position: relative;
  padding: 3rem 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 900px) {
  .auth-form-wrap { padding: 2rem 1.5rem 2.5rem; }
}

.auth-back-link {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #94a3b8;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-back-link:hover { color: var(--skymed, #598dd1); }

.auth-form-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}
.auth-form-card--wide { max-width: 440px; }

.auth-form-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.5rem;
}
.auth-form-sub {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0 0 1.75rem;
}

/* ---- Social buttons (Diia + BankID) ---- */
.auth-form-card .social-auth-buttons,
div.social-auth-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}
.auth-form-card .social-btn,
a.social-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem !important;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
  box-sizing: border-box;
}
.auth-form-card .social-btn:hover { transform: translateY(-1px); }
.auth-form-card .social-btn-diia,
a.social-btn-diia {
  background: #000 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.35);
}
.auth-form-card .social-btn-diia:hover { box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.5); }
.auth-form-card .social-btn-bankid,
a.social-btn-bankid {
  background: #00529b !important;
  color: #fff !important;
  box-shadow: 0 4px 12px -4px rgba(0, 82, 155, 0.35);
}
.auth-form-card .social-btn-bankid:hover { box-shadow: 0 8px 20px -5px rgba(0, 82, 155, 0.5); }

.auth-or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1.25rem;
  color: #94a3b8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-or-divider::before,
.auth-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Drupal form items styling */
.auth-form-card form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form-card .form-item { margin: 0; }
.auth-form-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.375rem;
}
.auth-form-card label .form-required {
  color: #dc2626;
  text-decoration: none;
}
.auth-form-card input[type="text"],
.auth-form-card input[type="email"],
.auth-form-card input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.auth-form-card input:focus {
  outline: none;
  background: #fff;
  border-color: var(--skymed, #598dd1);
  box-shadow: 0 0 0 4px rgba(89, 141, 209, 0.12);
}
.auth-form-card .description {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.375rem;
}
/* Hide Russian password strength/confirm texts but keep the input wrappers visible */
.auth-form-card .password-strength,
.auth-form-card .password-suggestions,
.auth-form-card .password-strength__meter,
.auth-form-card .password-strength__title,
.auth-form-card .password-strength__text,
.auth-form-card .password-confirm-message,
.auth-form-card .password-confirm-match {
  display: none !important;
}
/* Override Drupal password.module's broken layout (it uses float/overflow that collapse without strength meter) */
.auth-form-card .password-parent,
.auth-form-card .confirm-parent,
.auth-form-card .password-confirm-parent,
.auth-form-card #edit-pass,
.auth-form-card #edit-pass > div,
.auth-form-card .form-item-pass-pass1,
.auth-form-card .form-item-pass-pass2 {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
  float: none !important;
  clear: none !important;
  margin: 0 0 1rem 0 !important;
  padding: 0 !important;
}
.auth-form-card .password-field,
.auth-form-card .password-confirm,
.auth-form-card #edit-pass-pass1,
.auth-form-card #edit-pass-pass2 {
  width: 100% !important;
  float: none !important;
  display: block !important;
}

.auth-form-card .form-actions {
  margin-top: 0.75rem;
}
.auth-form-card .form-actions input[type="submit"],
.auth-form-card .form-submit {
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2d5494 0%, #1e3a8a 100%);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.auth-form-card .form-actions input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px rgba(45, 84, 148, 0.5);
}

/* Hide noise that we don't want shown on auth forms */
.auth-form-card .item-list,
.auth-form-card .field--name-field-name,
.auth-form-card .field--name-user-picture,
.auth-form-card .form-item-contact,
.auth-form-card #edit-contact,
.auth-form-card #edit-timezone,
.auth-form-card #edit-language,
.auth-form-card #edit-actions-cancel { display: none !important; }

/* Drupal status / error messages */
.auth-form-card .messages {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.auth-form-card .messages--status { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.auth-form-card .messages--error  { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* Switch */
.auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 1.5rem;
}
.auth-switch a {
  color: var(--skymed, #598dd1);
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }
.auth-switch-divider { margin: 0 0.5rem; color: #cbd5e1; }

.auth-footnote {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
}
.auth-footnote a { color: inherit; }
.auth-footnote a:hover { color: var(--skymed, #598dd1); }
@media (max-width: 900px) {
  .auth-footnote { position: static; margin-top: 2rem; }
}
