:root{
  --dm-bg:#070b16;
  --dm-card:#0f1a2d;
  --dm-card-2:#101b31;
  --dm-line:rgba(148,163,184,.22);
  --dm-line-strong:rgba(244,63,124,.35);
  --dm-text:#f8fafc;
  --dm-muted:#9aa8bd;
  --dm-soft:#c8d3e3;
  --dm-accent:#ec1b63;
  --dm-accent-2:#ff5b93;
  --dm-blue:#0f3b85;
  --dm-shadow:0 28px 80px rgba(2,6,23,.46);
}

body.dm-auth-page{
  min-height:100vh;
  margin:0;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--dm-text);
  background:var(--dm-bg);
  overflow-x:hidden;
}

.dm-auth-bg{position:fixed;inset:0;z-index:-1;background:
  radial-gradient(circle at 22% 16%,rgba(236,27,99,.28),transparent 31%),
  radial-gradient(circle at 82% 62%,rgba(15,59,133,.55),transparent 36%),
  linear-gradient(135deg,#070b16 0%,#091122 45%,#14091c 100%);
}
.dm-auth-glow{position:absolute;border-radius:999px;filter:blur(44px);opacity:.56;pointer-events:none;}
.dm-auth-glow-a{width:360px;height:360px;left:8%;top:8%;background:rgba(236,27,99,.22)}
.dm-auth-glow-b{width:420px;height:420px;right:8%;bottom:8%;background:rgba(37,99,235,.18)}
.dm-auth-grid{position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.03) 1px,transparent 1px);background-size:72px 72px;mask-image:radial-gradient(circle at center,black,transparent 72%);opacity:.55}

.dm-auth-shell{
  width:min(1120px,calc(100% - 40px));
  min-height:100vh;
  margin:0 auto;
  display:grid;
  grid-template-columns:minmax(360px,470px) 1fr;
  gap:34px;
  align-items:center;
  padding:42px 0;
}

.dm-auth-panel{
  background:linear-gradient(180deg,rgba(17,29,51,.92),rgba(12,20,36,.94));
  border:1px solid var(--dm-line);
  box-shadow:var(--dm-shadow);
  border-radius:30px;
  padding:26px;
  backdrop-filter:blur(18px);
}

.dm-auth-brandline,.dm-auth-row-between,.dm-auth-oauth-row,.dm-auth-actions,.dm-auth-footer{display:flex;align-items:center;gap:12px}
.dm-auth-brandline{justify-content:space-between;margin-bottom:28px}
.dm-auth-logo{display:inline-flex;align-items:center;gap:10px;color:var(--dm-text);text-decoration:none;font-weight:800;letter-spacing:-.03em}
.dm-auth-logo img{width:38px;height:38px;object-fit:contain;border-radius:12px;box-shadow:0 8px 28px rgba(236,27,99,.16)}
.dm-auth-logo-fallback::before{content:'✉';display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,var(--dm-accent),var(--dm-blue));}
.dm-auth-mini-link,.dm-auth-link,.dm-auth-footer a{color:#f7a3c0;text-decoration:none;font-weight:700;font-size:13px}
.dm-auth-mini-link{padding:9px 12px;border:1px solid rgba(236,27,99,.25);border-radius:999px;background:rgba(236,27,99,.08)}
.dm-auth-mini-link:hover,.dm-auth-link:hover,.dm-auth-footer a:hover{color:#fff}

.dm-auth-copy{margin-bottom:22px}
.dm-auth-pill{display:inline-flex;align-items:center;width:max-content;padding:7px 11px;border-radius:999px;background:rgba(236,27,99,.15);border:1px solid rgba(236,27,99,.25);color:#ff8fb3;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;margin-bottom:14px}
.dm-auth-copy h1{font-size:36px;line-height:1.04;margin:0 0 10px;letter-spacing:-.06em;color:#fff}
.dm-auth-copy p{margin:0;color:var(--dm-muted);line-height:1.65;font-size:15px}

.dm-auth-alert{display:grid;gap:3px;padding:13px 14px;border-radius:18px;background:rgba(239,68,68,.12);border:1px solid rgba(248,113,113,.26);color:#fecaca;margin-bottom:16px;font-size:13px}.dm-auth-alert strong{color:#fff}

.dm-auth-form{display:grid;gap:14px}.dm-auth-field{display:grid;gap:8px}.dm-auth-field span,.dm-auth-field>span{font-size:12px;text-transform:uppercase;letter-spacing:.09em;color:#9fb0ca;font-weight:800}.dm-auth-field input,.dm-auth-field select{width:100%;height:48px;box-sizing:border-box;border:1px solid var(--dm-line);border-radius:16px;background:rgba(3,8,20,.56);color:#f8fafc;padding:0 14px;font:inherit;outline:none;transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.dm-auth-field input::placeholder{color:#7f8da4}.dm-auth-field input:focus,.dm-auth-field select:focus{border-color:rgba(236,27,99,.55);box-shadow:0 0 0 4px rgba(236,27,99,.14);background:rgba(7,12,25,.78)}
.dm-auth-password-wrap{position:relative}.dm-auth-password-wrap input{padding-right:86px}.dm-auth-eye{position:absolute;right:7px;top:7px;height:34px;border:0;border-radius:12px;background:rgba(255,255,255,.07);color:#dce6f4;font-weight:800;padding:0 12px;cursor:pointer}.dm-auth-eye:hover{background:rgba(255,255,255,.12)}.dm-auth-field small{color:#fbcfe8;font-size:12px;line-height:1.5}

.dm-auth-provider{display:grid;gap:3px;padding:12px 13px;border-radius:16px;background:rgba(14,165,233,.1);border:1px solid rgba(56,189,248,.2);color:#d9f4ff;font-size:13px}.dm-auth-provider strong{color:#fff}.dm-auth-provider span{color:#a9bfd7}
.dm-auth-row-between{justify-content:space-between}.dm-auth-check{display:inline-flex;align-items:center;gap:8px;color:var(--dm-soft);font-size:13px}.dm-auth-check input{accent-color:var(--dm-accent)}

.dm-auth-advanced{border:1px solid rgba(148,163,184,.16);border-radius:18px;background:rgba(255,255,255,.035);overflow:hidden}.dm-auth-advanced summary{cursor:pointer;padding:13px 14px;color:#dbe7f7;font-size:13px;font-weight:800;list-style:none}.dm-auth-advanced summary::-webkit-details-marker{display:none}.dm-auth-advanced summary::after{content:'›';float:right;transform:rotate(90deg);opacity:.7}.dm-auth-advanced[open] summary{border-bottom:1px solid rgba(148,163,184,.12)}.dm-auth-advanced-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px}.dm-auth-field-wide{grid-column:1/-1}

.dm-auth-primary,.dm-auth-action-primary{height:50px;border:0;border-radius:16px;background:linear-gradient(135deg,var(--dm-accent),var(--dm-accent-2));color:#fff;font-weight:900;letter-spacing:-.01em;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;text-decoration:none;box-shadow:0 16px 36px rgba(236,27,99,.24);transition:transform .18s ease,filter .18s ease}.dm-auth-primary:hover,.dm-auth-action-primary:hover{transform:translateY(-1px);filter:brightness(1.05)}
.dm-auth-separator{position:relative;text-align:center;margin:7px 0;color:#7e8aa0;font-size:12px}.dm-auth-separator::before{content:'';position:absolute;left:0;right:0;top:50%;height:1px;background:rgba(148,163,184,.16)}.dm-auth-separator span{position:relative;background:#101b31;padding:0 10px}
.dm-auth-oauth-row{gap:10px}.dm-auth-oauth,.dm-auth-action-secondary{flex:1;min-height:46px;border:1px solid var(--dm-line);border-radius:16px;background:rgba(255,255,255,.045);color:#e9f2ff;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:10px;font-weight:800;font-size:14px}.dm-auth-oauth:hover,.dm-auth-action-secondary:hover{border-color:rgba(236,27,99,.32);background:rgba(236,27,99,.07)}
.dm-auth-actions{margin-top:4px}.dm-auth-action-primary,.dm-auth-action-secondary{flex:1}.dm-auth-footer{justify-content:center;flex-wrap:wrap;margin-top:20px;color:#748197;font-size:12px}.dm-auth-footer span{color:#526078}

.dm-auth-side{align-self:stretch;display:flex;align-items:center}.dm-auth-side-card{width:100%;min-height:520px;border-radius:34px;border:1px solid rgba(255,255,255,.1);background:linear-gradient(135deg,rgba(15,59,133,.55),rgba(236,27,99,.2)),linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.03));box-shadow:0 34px 90px rgba(2,6,23,.36);padding:42px;display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden;position:relative}.dm-auth-side-card::before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 30% 20%,rgba(255,255,255,.18),transparent 28%),radial-gradient(circle at 85% 78%,rgba(236,27,99,.3),transparent 34%);pointer-events:none}.dm-auth-side-card>*{position:relative}.dm-auth-side-label{width:max-content;border-radius:999px;padding:7px 12px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.13);font-size:12px;text-transform:uppercase;letter-spacing:.09em;color:#dbeafe;font-weight:900}.dm-auth-side h2{font-size:46px;line-height:1.02;letter-spacing:-.07em;margin:18px 0 12px;color:#fff;max-width:560px}.dm-auth-side p{color:#d3dcec;font-size:16px;line-height:1.65;margin:0 0 26px;max-width:520px}.dm-auth-feature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.dm-auth-feature-grid div{border:1px solid rgba(255,255,255,.12);border-radius:20px;background:rgba(3,8,20,.26);padding:16px}.dm-auth-feature-grid strong{display:block;color:#fff;margin-bottom:5px}.dm-auth-feature-grid span{color:#b6c5dc;font-size:13px;line-height:1.45}

@media (max-width:920px){.dm-auth-shell{grid-template-columns:1fr;max-width:520px}.dm-auth-side{display:none}.dm-auth-panel{padding:22px}.dm-auth-copy h1{font-size:31px}}
@media (max-width:560px){.dm-auth-shell{width:calc(100% - 22px);padding:18px 0}.dm-auth-panel{border-radius:24px}.dm-auth-brandline,.dm-auth-actions,.dm-auth-oauth-row{flex-direction:column;align-items:stretch}.dm-auth-mini-link{text-align:center}.dm-auth-advanced-grid{grid-template-columns:1fr}.dm-auth-copy h1{font-size:28px}.dm-auth-row-between{align-items:flex-start;gap:10px;flex-direction:column}}


/* Phase 16O: clean auth action buttons */
.dm-auth-actions{
  display:grid;
  grid-template-columns:1.15fr .95fr;
  gap:10px;
  align-items:stretch;
  margin-top:8px;
}
.dm-auth-actions .dm-auth-action-primary,
.dm-auth-actions .dm-auth-action-secondary{
  min-height:44px;
  height:44px;
  border-radius:14px;
  font-size:13px;
  line-height:1.1;
  white-space:nowrap;
  padding:0 13px;
  box-sizing:border-box;
  box-shadow:none;
  transform:none;
}
.dm-auth-actions .dm-auth-action-primary{
  background:rgba(236,27,99,.12);
  border:1px solid rgba(236,27,99,.32);
  color:#ffd6e5;
}
.dm-auth-actions .dm-auth-action-primary:hover{
  background:rgba(236,27,99,.18);
  border-color:rgba(255,91,147,.5);
  color:#fff;
  transform:none;
  filter:none;
}
.dm-auth-actions .dm-auth-action-secondary{
  background:rgba(255,255,255,.045);
  border:1px solid rgba(148,163,184,.22);
  color:#e9f2ff;
}
.dm-auth-actions .dm-auth-action-secondary:hover{
  background:rgba(255,255,255,.07);
  border-color:rgba(148,163,184,.36);
  color:#fff;
}
@media (max-width:560px){
  .dm-auth-actions{grid-template-columns:1fr;}
  .dm-auth-actions .dm-auth-action-primary,
  .dm-auth-actions .dm-auth-action-secondary{width:100%;}
}

/* Phase 16T: mailbox login scroll fix
   Keep the auth page premium, but never trap the user when the card is taller than the viewport. */
html{
  min-height:100%;
  height:auto !important;
  overflow-y:auto !important;
  overflow-x:hidden;
}
body.dm-auth-page{
  min-height:100dvh;
  height:auto !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch;
}
body.dm-auth-page .dm-auth-bg{
  position:fixed;
  min-height:100dvh;
}
.dm-auth-shell{
  min-height:100dvh;
  height:auto !important;
  align-items:center;
  box-sizing:border-box;
}
.dm-auth-panel,
.dm-auth-side-card{
  max-height:none;
}
@media (max-height:820px){
  .dm-auth-shell{
    align-items:flex-start;
    padding-top:28px;
    padding-bottom:28px;
  }
  .dm-auth-panel{
    margin-top:0;
    margin-bottom:0;
  }
  .dm-auth-brandline{margin-bottom:18px;}
  .dm-auth-copy{margin-bottom:16px;}
  .dm-auth-copy h1{font-size:31px;}
  .dm-auth-form{gap:11px;}
  .dm-auth-field input,
  .dm-auth-field select{height:44px;}
  .dm-auth-primary{height:46px;}
}
@media (max-width:920px){
  .dm-auth-shell{
    align-items:flex-start;
    min-height:100dvh;
    padding-top:22px;
    padding-bottom:22px;
  }
}
