/* =========================================================
   Domis EHS — Auth pages shared styles
   Used by: login, signup, forgot, reset, verify
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --brand-blue:        #2563eb;
  --brand-blue-dark:   #1d4ed8;
  --brand-blue-soft:   #3b82f6;
  --brand-blue-tint:   rgba(37, 99, 235, 0.12);
  --brand-blue-ring:   rgba(37, 99, 235, 0.18);
  --brand-green:       #22c55e;

  --text-primary:      #0f172a;
  --text-secondary:    #475569;
  --text-muted:        #94a3b8;

  --border-soft:       #e5e7eb;
  --border-default:    #d1d5db;

  --bg-input:          #ffffff;

  --radius-card:       24px;
  --radius-input:      12px;
  --radius-button:     12px;

  --font-sans:         "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body.auth-page {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Page background: soft top-to-bottom blue → white ---------- */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, #cfe2fb 0%, #e6f0fc 38%, #f4f8fd 72%, #ffffff 100%);
}

/* Subtle decorative orbs for depth (very gentle) */
.page-bg::before,
.page-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  pointer-events: none;
}
.page-bg::before {
  width: 520px; height: 520px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.55), rgba(96, 165, 250, 0));
}
.page-bg::after {
  width: 620px; height: 620px;
  bottom: -200px; right: -160px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.28), rgba(34, 197, 94, 0));
}

/* ---------- Layout ---------- */
.auth-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

/* ---------- Split card ---------- */
.split-card {
  width: 100%;
  max-width: 940px;
  min-height: 580px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-card);
  box-shadow:
    0 30px 80px -24px rgba(15, 23, 42, 0.28),
    0 8px 24px -10px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  overflow: hidden;
  animation: cardIn 480ms cubic-bezier(.2, .9, .2, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Left: media side ---------- */
.split-card__media {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 36px 32px 28px;
  background:
    linear-gradient(160deg, rgba(207, 226, 251, 0.55) 0%, rgba(219, 234, 254, 0.35) 50%, rgba(220, 252, 231, 0.35) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
}

.media-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.media-logo img {
  max-width: 140px;
  width: 100%;
  height: auto;
  display: block;
}

.media-illustration {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 12px;
}

.media-illustration img {
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ---------- Right: form side ---------- */
.split-card__form {
  padding: 48px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-head {
  margin-bottom: 28px;
}

.form-head h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.form-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---------- Form ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  position: relative;
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  display: inline-flex;
}

.field-icon svg { width: 18px; height: 18px; }

.field input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input::placeholder { color: var(--text-muted); }

.field input:focus,
.field input:focus-visible {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px var(--brand-blue-ring);
}

.field input[type="password"] {
  padding-right: 44px;
  letter-spacing: 0.08em;
}

.field-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}

.field-toggle:hover { background: #f1f5f9; color: var(--text-secondary); }
.field-toggle svg { width: 18px; height: 18px; }

/* ---------- Row + links ---------- */
.auth-row-right {
  display: flex;
  justify-content: flex-end;
  margin-top: -2px;
}

.auth-link {
  color: var(--brand-blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 120ms ease;
}

.auth-link:hover { color: var(--brand-blue-dark); }
.auth-link-strong { font-weight: 600; }

/* ---------- Submit button ---------- */
.auth-submit {
  margin-top: 10px;
  position: relative;
  height: 50px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
  border: 0;
  border-radius: var(--radius-button);
  cursor: pointer;
  box-shadow:
    0 8px 20px -8px rgba(37, 99, 235, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 120ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 10px 24px -8px rgba(37, 99, 235, 0.65),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.auth-submit:active:not(:disabled) { transform: translateY(1px); }

.auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.auth-submit-arrow {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.auth-submit:hover:not(:disabled) .auth-submit-arrow { transform: translateX(2px); }

.auth-submit-spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  display: none;
  animation: spin 720ms linear infinite;
}

.auth-submit.is-loading .auth-submit-label,
.auth-submit.is-loading .auth-submit-arrow { visibility: hidden; }

.auth-submit.is-loading .auth-submit-spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.auth-footer {
  margin: 24px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---------- Status views (success / error / loading) ---------- */
.auth-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0;
  animation: cardIn 320ms cubic-bezier(.2, .9, .2, 1) both;
}

.auth-status-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.auth-status-icon svg {
  width: 36px;
  height: 36px;
}

.auth-status-icon.is-success {
  background: rgba(34, 197, 94, 0.14);
  color: var(--brand-green);
}

.auth-status-icon.is-info {
  background: rgba(59, 130, 246, 0.14);
  color: var(--brand-blue);
}

.auth-status-icon.is-error {
  background: rgba(248, 113, 113, 0.14);
  color: #dc2626;
}

.auth-status-icon.is-loading {
  background: rgba(59, 130, 246, 0.10);
  color: var(--brand-blue);
}

.status-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--brand-blue);
  animation: spin 720ms linear infinite;
}

.auth-status h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.auth-status p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.auth-status-actions {
  margin-top: 26px;
}

.auth-status-actions .auth-link {
  font-size: 14px;
}

/* ---------- Toast ---------- */
.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(8px);
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1px;
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  max-width: min(520px, calc(100vw - 28px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.auth-toast.is-success {
  background: rgba(220, 252, 231, 0.92);
  color: #14532d;
  border-color: rgba(34, 197, 94, 0.32);
}
.auth-toast.is-error {
  background: rgba(254, 226, 226, 0.92);
  color: #7f1d1d;
  border-color: rgba(248, 113, 113, 0.38);
}
.auth-toast.is-info {
  background: rgba(219, 234, 254, 0.92);
  color: #1e3a8a;
  border-color: rgba(59, 130, 246, 0.32);
}

/* =========================================================
   Responsive
   ========================================================= */

/* Tablet — slightly tighter padding, keep split */
@media (max-width: 1024px) {
  .split-card { max-width: 860px; min-height: 540px; }
  .split-card__form { padding: 40px 36px; }
  .media-logo img { max-width: 200px; }
  .media-illustration img { max-height: 320px; }
}

/* Mobile — stack: hide media side, form-only with logo at top */
@media (max-width: 760px) {
  .split-card {
    grid-template-columns: 1fr;
    min-height: 0;
    max-width: 440px;
  }
  .split-card__media {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    padding: 28px 24px 20px;
    flex-direction: row;
    justify-content: center;
  }
  .media-logo img { max-width: 180px; }
  .media-illustration { display: none; }

  .split-card__form { padding: 32px 28px 28px; }
  .form-head h1 { font-size: 24px; }
}