/* DocLink auth screens — mirrors the Figma "Welcome to DocLink" modal. */

:root {
  --auth-primary: #0EA882;
  --auth-bg: #f8fafa;
  --auth-fg: #0a1c17;
  --auth-muted: #f2f8f6;
  --auth-muted-fg: #6b8f84;
  --auth-border: rgba(14, 168, 130, 0.35);
  --auth-border-soft: rgba(14, 168, 130, 0.21);
}

.dl-auth {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #6d7b75;
  background-image: radial-gradient(120% 90% at 50% 0%, rgba(14, 168, 130, 0.22), transparent 70%);
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--auth-fg);
  -webkit-font-smoothing: antialiased;
}

/* Card ------------------------------------------------------------------ */

.dl-auth__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  padding: 32px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(10, 28, 23, 0.35);
}

.dl-auth__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: var(--auth-muted);
  color: var(--auth-fg);
  cursor: pointer;
  transition: background 0.15s;
}

.dl-auth__close:hover { background: var(--auth-border); }
.dl-auth__close svg { width: 16px; height: 16px; }

.dl-auth__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  text-decoration: none;
  color: inherit;
}

/* The .dl-logo mark is 36px/teal from app.css; only the wordmark size differs here. */
.dl-auth__brand .dl-logo__text { font-size: 18px; }

.dl-auth__title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dl-auth__subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--auth-muted-fg);
}

.dl-auth__alert {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
  font-size: 13px;
  font-weight: 500;
  color: #b91c1c;
}

/* Provider buttons ------------------------------------------------------ */

.dl-auth__options { display: grid; gap: 10px; }

.dl-auth__provider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--auth-border-soft);
  border-radius: 14px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-fg);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dl-auth__provider:hover { background: var(--auth-muted); }

.dl-auth__provider svg { width: 20px; height: 20px; flex-shrink: 0; }

.dl-auth__provider--apple {
  border-color: #000;
  background: #000;
  color: #fff;
}

.dl-auth__provider--apple:hover { background: #111827; }

.dl-auth__provider-icon { width: 18px; height: 18px; flex-shrink: 0; }
.dl-auth__provider-icon--primary { color: var(--auth-primary); }
.dl-auth__provider-icon--muted { color: var(--auth-muted-fg); }

.dl-auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.dl-auth__divider::before,
.dl-auth__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.dl-auth__divider span { font-size: 12px; color: var(--auth-muted-fg); }

.dl-auth__guest {
  display: block;
  width: 100%;
  padding: 10px 0;
  text-decoration: none;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-muted-fg);
  text-align: center;
  cursor: pointer;
  transition: color 0.15s;
}

.dl-auth__guest:hover { color: var(--auth-fg); }

/* Email panel ---------------------------------------------------------- */

.dl-auth__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--auth-muted-fg);
  cursor: pointer;
  transition: color 0.15s;
}

.dl-auth__back:hover { color: var(--auth-fg); }
.dl-auth__back svg { width: 14px; height: 14px; }

.dl-auth__fields { display: grid; gap: 12px; }

.dl-auth__label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--auth-muted-fg);
}

.dl-auth__input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  appearance: none;
  border: 1px solid var(--auth-border-soft);
  border-radius: 14px;
  background: var(--auth-bg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--auth-fg);
}

.dl-auth__input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(14, 168, 130, 0.15);
}

/* .border-red-400 is applied by ax-form-scripts on validation failure. */
.dl-auth__input--error,
.dl-auth__input.border-red-400 { border-color: #f87171; }

.dl-auth__error {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
}

.dl-auth__error.hidden { display: none; }

.dl-auth__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-muted-fg);
  cursor: pointer;
}

.dl-auth__remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--auth-primary);
  cursor: pointer;
}

.dl-auth__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--auth-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}

.dl-auth__submit:hover { opacity: 0.92; }
.dl-auth__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.dl-auth__footnote {
  margin: 16px 0 0;
  font-size: 12px;
  text-align: center;
  color: var(--auth-muted-fg);
}

.dl-auth__link {
  font-weight: 700;
  color: var(--auth-primary);
  text-decoration: none;
}

.dl-auth__link:hover { text-decoration: underline; }

.dl-auth__lang {
  display: flex;
  justify-content: flex-start;
  margin: 20px 0 -8px;
}

/* Panels are swapped by public/js/public-auth.js */
.dl-auth__panel[hidden] { display: none; }

@media (max-width: 420px) {
  .dl-auth__card { padding: 24px 20px; }
}
