/* public/css/mobile/login.css
 * Dive Command Mobile (DCM) — sign-in page ONLY (views/mobile/login.ejs +
 * views/mobile/login-shared.ejs). NOT loaded by the app shell, so it is safe
 * to iterate on without a dcm.css cache-version bump (dcm.css is
 * SW-precached; this file intentionally is not part of that surface).
 *
 * Purpose: layer "web-inspired, mobile-native" polish on top of the base
 * `.dcm-login*` structure already defined in dcm.css (gradient backdrop,
 * white card, tokens). This file does NOT redefine layout — it refines
 * hierarchy, depth, and the Google/password affordances to echo the web
 * login (views/login.ejs): branded gradient behind a white card, a real
 * multicolor Google icon, a tidy "or" divider, and a clean password form.
 *
 * Token-driven only: every color reads var(--primary-color) / var(--dcm-*)
 * (defined in branding-css.ejs + dcm.css). NOTHING is hardcoded per-tenant.
 * Dark mode: the --dcm-* tokens already flip under body.dark-mode in
 * dcm.css, so most rules here need no explicit dark override — the few that
 * do (shadow depth, the backdrop glow) are called out below.
 */

/* ---------- Backdrop ---------- */

/* Subtle radial highlight over the existing brand gradient (dcm.css) for
 * depth, echoing the web login's card-on-gradient composition without
 * changing the gradient itself. Purely decorative — kept behind content. */
.dcm-login {
  position: relative;
  overflow-x: hidden;
}

.dcm-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 60% at 50% -10%,
    color-mix(in srgb, #fff 22%, transparent) 0%, transparent 65%);
  pointer-events: none;
}

.dcm-login__brand,
.dcm-login__card {
  position: relative;
  z-index: 1;
}

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

.dcm-login__card {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: dcm-login-card-in 0.35s ease-out;
}

/* Thin brand accent bar along the card top — the web-inspired cue without
 * splitting the header into a separate block (mobile stays one card). */
.dcm-login__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

body.dark-mode .dcm-login__card {
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

@keyframes dcm-login-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .dcm-login__card { animation: none; }
}

/* ---------- Brand header ---------- */

.dcm-login__brand { margin-bottom: 22px; }

.dcm-login__logo-img { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08)); }

.dcm-login__org {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* ---------- Google button ---------- */

.dcm-btn--google {
  gap: 12px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.dcm-btn--google:active {
  transform: scale(0.98);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

body.dark-mode .dcm-btn--google {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

/* Icon slot for the real multicolor Google SVG (google-icon.ejs), replacing
 * the old text-"G" circle treatment. */
.dcm-login__g-icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}

/* ---------- Hint + divider ---------- */

.dcm-login__hint { opacity: 0.85; }

.dcm-divider {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

/* ---------- Collapsible password section ---------- */

.dcm-login__secondary-toggle {
  position: relative;
  padding: 12px 32px;
  font-weight: 500;
  border-radius: 10px;
  background: var(--dcm-surface-2);
  transition: color 0.15s ease;
}

.dcm-login__secondary-toggle::after {
  content: '\203A';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transition: transform 0.15s ease;
}

.dcm-login__secondary[open] .dcm-login__secondary-toggle::after {
  transform: translateY(-50%) rotate(-90deg);
}

/* ---------- Form fields ---------- */

.dcm-field label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.4px;
}

.dcm-input {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dcm-input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dcm-accent) 25%, transparent);
}

.dcm-login .dcm-btn[type='submit'] {
  transition: transform 0.08s ease;
}

.dcm-login .dcm-btn[type='submit']:active {
  transform: scale(0.98);
}
