/* ==========================================================
   Auth
   ========================================================== */

.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
  background: var(--page-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  border-radius: var(--radius-lg);
  padding: 20px 18px 12px;
  background: var(--glass-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

body:not(.light) .auth-card{
  background:
    linear-gradient(180deg, rgba(255,246,232,.026) 0%, rgba(255,246,232,.008) 16%, rgba(255,246,232,0) 34%),
    radial-gradient(980px 360px at 50% -8%, rgba(214,192,168,.045), transparent 52%),
    linear-gradient(180deg, rgba(20,20,22,.94) 0%, rgba(10,10,12,.90) 100%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow:
    inset 0 1px 0 rgba(255,246,232,.04),
    inset 0 -1px 0 rgba(0,0,0,.30),
    0 24px 56px rgba(0,0,0,.42);
}

body:not(.light) .auth-card::before{
  content:none;
}

body:not(.light) .auth-card > *{
  position:relative;
  z-index:1;
}

.auth-brand{ margin-bottom:10px; }
.auth-title{ margin:0; font-size:20px; letter-spacing:0.01em; }

.auth-view{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.auth-entry-view{
  gap:8px;
}

.auth-entry-view .field-group{
  margin-top:10px;
}

.auth-subcopy{
  max-width:300px;
  margin-left:auto;
  margin-right:auto;
  line-height:1.45;
}

.auth-actions{
  margin-top:16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}

.auth-entry-actions{
  margin-top:22px;
  gap:12px;
}

.auth-main-btn{
  width:100%;
  max-width:320px;
  text-align:center;
  height:40px;
  min-height:40px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.auth-primary-btn{
  border-radius:20px !important;
  border:1px solid #8e918f !important;
  background-color:#131314 !important;
  background-image:none !important;
  color:#e3e3e3 !important;
  font-family:'Roboto', arial, sans-serif;
  font-size:14px;
  font-weight:500;
  letter-spacing:0.25px;
  box-shadow:none;
}

.auth-primary-btn:hover{
  border-color:#8e918f !important;
  color:#e3e3e3 !important;
  background-color:#131314 !important;
  background-image:none !important;
  box-shadow:0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
}

.auth-primary-btn:active{
  transform:translateY(0);
  box-shadow:none;
}

.gsi-material-button {
  -moz-user-select:none;
  -webkit-user-select:none;
  -ms-user-select:none;
  user-select:none;
  -webkit-appearance:none;
  appearance:none;
  background-color:#131314;
  background-image:none;
  border:1px solid #8e918f;
  border-radius:20px;
  box-sizing:border-box;
  color:#e3e3e3;
  cursor:pointer;
  font-family:'Roboto', arial, sans-serif;
  font-size:14px;
  height:40px;
  letter-spacing:0.25px;
  outline:none;
  overflow:hidden;
  padding:0 12px;
  position:relative;
  text-align:center;
  transition:background-color .218s, border-color .218s, box-shadow .218s, transform .16s ease;
  vertical-align:middle;
  white-space:nowrap;
  width:100%;
  max-width:320px;
  min-width:min-content;
}

.metryx-auth-button{
  -webkit-appearance:none;
  appearance:none;
  width:100%;
  max-width:320px;
  min-width:min-content;
  height:40px;
  padding:0 12px;
  border-radius:20px;
  border:1px solid #8e918f;
  background:
    linear-gradient(180deg, rgba(255,246,232,0.024), rgba(255,246,232,0.008)),
    linear-gradient(180deg, rgba(20,20,22,0.96), rgba(12,12,14,0.96));
  color:var(--text);
  box-sizing:border-box;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  text-align:center;
  transition:background-color .218s, border-color .218s, box-shadow .218s, transform .16s ease;
}

.metryx-auth-button::before{
  content:none;
}

.metryx-auth-button-icon,
.metryx-auth-button-text{
  position:relative;
  z-index:1;
}

.metryx-auth-button-icon{
  width:24px;
  min-width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-right:10px;
}

.metryx-auth-button-icon img{
  width:24px;
  height:24px;
  object-fit:contain;
  filter:none;
}

.metryx-auth-button-text{
  flex:1;
  font-family:'Roboto', arial, sans-serif;
  font-size:14px;
  font-weight:500;
  letter-spacing:0.25px;
}

.metryx-auth-button-balance{
  width:24px;
  min-width:24px;
  height:24px;
  position:relative;
  z-index:1;
}

.auth-switch-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}

.auth-switch-button{
  width:100%;
  min-width:min-content;
  max-width:320px;
  padding:0 12px;
  justify-content:flex-start;
  gap:10px;
}

.auth-switch-button .metryx-auth-button-text{
  flex:1;
}

.metryx-auth-button.is-busy{
  cursor:progress;
}

.metryx-auth-button:disabled{
  cursor:default;
  opacity:.62;
}

.metryx-auth-button:not(:disabled):hover{
  transform:translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,247,236,.05),
    inset 0 -1px 0 rgba(0,0,0,.32),
    0 18px 42px rgba(0,0,0,.30);
  border-color:#8e918f;
}

.metryx-auth-button:not(:disabled):focus,
.metryx-auth-button:not(:disabled):active{
  transform:translateY(0);
}

.gsi-material-button.is-busy,
.auth-main-btn.is-busy{
  cursor:progress;
}

.gsi-material-button .gsi-material-button-icon {
  height:20px;
  margin-right:10px;
  min-width:20px;
  width:20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
  align-items:center;
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  height:100%;
  justify-content:space-between;
  position:relative;
  width:100%;
}

.gsi-material-button .gsi-material-button-contents {
  flex-grow:1;
  font-family:'Roboto', arial, sans-serif;
  font-weight:500;
  overflow:hidden;
  text-overflow:ellipsis;
  vertical-align:top;
}

.gsi-material-button.is-busy .gsi-material-button-contents{
  opacity:.72;
}

.gsi-material-button .gsi-material-button-state {
  transition:opacity .218s;
  bottom:0;
  left:0;
  opacity:0;
  position:absolute;
  right:0;
  top:0;
}

.gsi-material-button:disabled {
  cursor:default;
  background-color:#13131461;
  border-color:#8e918f1f;
}

.gsi-material-button:disabled .gsi-material-button-state {
  background-color:#e3e3e31f;
}

.gsi-material-button:disabled .gsi-material-button-contents,
.gsi-material-button:disabled .gsi-material-button-icon {
  opacity:38%;
}

.gsi-material-button:not(:disabled):active,
.gsi-material-button:not(:disabled):focus{
  transform:translateY(0);
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state,
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color:#fff;
  opacity:12%;
}

.gsi-material-button:not(:disabled):hover {
  box-shadow:0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  transform:translateY(-1px);
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color:#fff;
  opacity:8%;
}

.auth-divider{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  margin:4px 0 2px;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.auth-divider::before,
.auth-divider::after{
  content:"";
  flex:1;
  height:1px;
  background:color-mix(in srgb, var(--border) 84%, transparent);
}

.auth-divider span{
  white-space:nowrap;
  opacity:.88;
}

.auth-notice-overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(3,5,8,.56);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  z-index:85;
}

.auth-notice-overlay.open{
  display:flex;
}

.auth-notice-card{
  width:min(460px, 100%);
  padding:22px 20px 18px;
  border-radius:28px;
  border:1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,246,232,.030), rgba(255,246,232,.010)),
    linear-gradient(180deg, rgba(20,20,22,.98), rgba(10,10,12,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,246,232,.05),
    0 24px 60px rgba(0,0,0,.34);
}

.auth-notice-kicker{
  font-size:11px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(201,213,225,.74);
}

.auth-notice-message{
  margin-top:12px;
  font-size:18px;
  line-height:1.5;
  color:var(--text);
  text-align:center;
}

.auth-notice-actions{
  margin-top:18px;
  display:flex;
  justify-content:center;
}

body.light .auth-notice-overlay{
  background:rgba(226,232,240,.48);
}

body.light .auth-notice-card{
  border:1px solid rgba(148,163,184,.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,247,251,.96)),
    linear-gradient(180deg, rgba(238,242,247,.94), rgba(230,236,243,.95));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 22px 50px rgba(15,23,42,.14);
}

body.light .auth-notice-kicker{
  color:rgba(71,85,105,.72);
}

body.light .gsi-material-button{
  background-color:#f2f2f2;
  border:none;
  color:#1f1f1f;
}

body.light .metryx-auth-button{
  border:1px solid color-mix(in srgb, var(--accent) 28%, rgba(15,23,42,0.18));
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,250,252,0.94)),
    radial-gradient(120% 180% at 0% 100%, rgba(66,235,255,.08), transparent 35%),
    radial-gradient(80% 140% at 100% 0%, rgba(255,157,80,.06), transparent 42%);
  color:#12202b;
}

body.light .auth-primary-btn{
  border:1px solid rgba(148,163,184,.38) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(239,244,249,.96)),
    linear-gradient(180deg, rgba(235,240,245,.9), rgba(223,230,238,.92)) !important;
  color:#111827 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(148,163,184,.18),
    0 12px 24px rgba(15,23,42,.12);
}

body.light .auth-primary-btn:hover{
  border-color:rgba(100,116,139,.42) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(244,247,251,.98)),
    linear-gradient(180deg, rgba(240,244,249,.94), rgba(228,234,241,.96)) !important;
  color:#0f172a !important;
}

body.light .gsi-material-button:disabled {
  background-color:#ffffff61;
}

body.light .gsi-material-button:disabled .gsi-material-button-state {
  background-color:#1f1f1f1f;
}

body.light .gsi-material-button:not(:disabled):active .gsi-material-button-state,
body.light .gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color:#001d35;
  opacity:12%;
}

body.light .gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color:#001d35;
  opacity:8%;
}

.auth-main-btn[disabled],
.gsi-material-button[disabled],
.metryx-auth-button[disabled],
.link-btn[disabled]{
  pointer-events:none;
}

.auth-forgot-password {
  margin-top: 18px;
  padding-top: 2px;
  text-align: center;
}

.auth-entry-view #signupPasswordRules{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:6px;
  align-items:stretch;
  transition:opacity .18s ease, transform .18s ease;
}

.auth-entry-view #signupPasswordRules.is-hidden{
  display:none;
}

.auth-entry-view #signupPasswordRules.is-collapsed{
  display:block;
  padding:6px 10px;
}

.signup-password-summary{
  display:none;
  color:var(--accent);
  font-weight:600;
  text-align:left;
}

.auth-entry-view #signupPasswordRules.is-collapsed .signup-password-summary{
  display:block;
}

.auth-entry-view #signupPasswordRules > div{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  min-height:20px;
  padding:0 4px;
  border-radius:6px;
  border:0;
  background:transparent;
  text-align:left;
  white-space:normal;
}

.auth-entry-view #signupPasswordRules.is-collapsed > div:not(.signup-password-summary){
  display:none !important;
}

#signupPasswordMatch{
  text-align:center;
  color:var(--muted);
}

.auth-forgot-password a {
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
}

.auth-forgot-password a:hover {
  text-decoration: underline;
}

.auth-flow-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin: 12px 0 22px;
  font-size: 13px;
  font-weight: 600;
  flex-wrap: wrap;
}

.auth-flow-progress .step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8c96a3;
}

.auth-flow-progress .label {
  line-height: 1;
}

.auth-flow-progress .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c8d0da;
  flex: 0 0 9px;
}

.auth-flow-progress .dot.active {
  background: #0f172a;
}

.auth-flow-progress .dot.done {
  background: #16a34a;
}

.auth-code-entry {
  position: relative;
}

.auth-code-slots {
  position: relative;
  cursor: text;
}

.auth-code-slot {
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.auth-code-slots.is-focused .auth-code-slot.is-active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent) !important;
  transform: translateY(-1px);
}

.auth-code-input {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 64px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: transparent !important;
  caret-color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.light .auth-flow-progress .step {
  color: #5b6472;
}

body.light .auth-flow-progress .dot {
  background: #cbd5e1;
}

body.light .auth-flow-progress .dot.active {
  background: #111827;
}

body.dark-mode .auth-flow-progress .step,
html[data-theme="dark"] .auth-flow-progress .step {
  color: #9aa4b2;
}

body.dark-mode .auth-flow-progress .dot,
html[data-theme="dark"] .auth-flow-progress .dot {
  background: rgba(255,255,255,0.22);
}

body.dark-mode .auth-flow-progress .dot.active,
html[data-theme="dark"] .auth-flow-progress .dot.active {
  background: #f5f7fb;
}

body.dark-mode .auth-flow-progress .dot.done,
html[data-theme="dark"] .auth-flow-progress .dot.done {
  background: #4ade80;
}

.auth-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  margin-bottom: 20px;
}

.auth-tagline {
  text-align: center;
}

.tagline-primary {
  font-size: 14px;
  font-weight: 500;
}

.tagline-secondary {
  font-size: 13px;
  opacity: 0.75;
}

@media (max-width: 600px) {
  .auth-logo-img {
    height: 45px;
  }
}

@media (max-width: 640px), (max-height: 840px){
  .auth-screen{
    align-items:center;
    justify-content:center;
    overflow-y:auto;
    padding:20px 12px;
  }

  .auth-card{
    max-width:400px;
    padding:16px 16px 10px;
    margin:auto 0;
  }

  .auth-brand{
    margin-bottom:6px;
  }

  .auth-entry-view{
    gap:6px;
  }

  .auth-entry-view .field-group{
    margin-top:8px;
  }

  .auth-entry-actions{
    margin-top:18px;
    gap:10px;
  }

  .auth-forgot-password{
    margin-top:14px;
  }

  .auth-entry-view #signupPasswordRules{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:6px;
  }

  .auth-entry-view #signupPasswordRules > div{
    min-height:20px;
    padding:0 2px;
  }
}
