body.dinarah-auth-lock { overflow: hidden; }
body.dinarah-auth-lock .app-shell { visibility: hidden; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 15%, rgba(23, 104, 93, .22), transparent 38%),
    radial-gradient(circle at 85% 80%, rgba(216, 163, 79, .18), transparent 35%),
    #071713;
  color: #f7fbfa;
}

.auth-gate[hidden] { display: none; }

.auth-shell {
  width: min(980px, 100%);
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(390px, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px;
  background: rgba(255,255,255,.07);
  box-shadow: 0 40px 100px rgba(0,0,0,.32);
  backdrop-filter: blur(24px);
}

.auth-story {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
}

.auth-brand { display: flex; gap: 14px; align-items: center; }
.auth-brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #f6faf9;
  color: #0d4f46;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -.04em;
}
.auth-brand strong { display: block; letter-spacing: .08em; font-size: 14px; }
.auth-brand span { display: block; margin-top: 3px; color: rgba(255,255,255,.62); font-size: 12px; }

.auth-story-copy h1 {
  margin: 0 0 16px;
  max-width: 460px;
  font-size: clamp(38px, 5vw, 60px);
  line-height: .98;
  letter-spacing: -.055em;
}
.auth-story-copy p {
  max-width: 420px;
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: 15px;
  line-height: 1.65;
}
.auth-points { display: grid; gap: 12px; margin-top: 30px; }
.auth-point { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.82); font-size: 13px; }
.auth-point svg { width: 17px; height: 17px; color: #9cd8cd; }
.auth-footnote { color: rgba(255,255,255,.42); font-size: 11px; }

.auth-panel {
  padding: 42px;
  display: flex;
  align-items: center;
  background: #f8faf9;
  color: #17201e;
}
.auth-panel-inner { width: 100%; max-width: 420px; margin: auto; }
.auth-kicker { margin: 0 0 8px; color: #0d4f46; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-panel h2 { margin: 0; font-size: 30px; line-height: 1.05; letter-spacing: -.04em; }
.auth-panel .auth-subtitle { margin: 10px 0 28px; color: #66716e; line-height: 1.55; font-size: 13px; }
.auth-form { display: grid; gap: 15px; }
.auth-form[hidden] { display: none; }
.auth-field { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: #33413e; }
.auth-field input {
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  border: 1px solid #dce4e1;
  border-radius: 13px;
  padding: 0 14px;
  background: #fff;
  color: #111916;
  outline: none;
  font: inherit;
  font-weight: 500;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-field input:focus { border-color: #3a8579; box-shadow: 0 0 0 4px rgba(13,79,70,.08); }
.auth-submit {
  height: 49px;
  border: 0;
  border-radius: 13px;
  background: #0d4f46;
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.auth-submit:hover { background: #0a443c; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { cursor: wait; opacity: .64; }
.auth-switch { margin: 20px 0 0; color: #66716e; text-align: center; font-size: 12px; }
.auth-switch button { border: 0; padding: 0; background: transparent; color: #0d4f46; font: inherit; font-weight: 800; cursor: pointer; }
.auth-error { min-height: 18px; margin: 0; color: #a12a21; font-size: 12px; line-height: 1.45; }

.cloud-account {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.cloud-account-top { display: flex; gap: 9px; align-items: center; }
.cloud-account-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 850; }
.cloud-account-copy { min-width: 0; flex: 1; }
.cloud-account-copy strong, .cloud-account-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cloud-account-copy strong { font-size: 11px; color: var(--text); }
.cloud-account-copy span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.cloud-sync-state { display: flex; gap: 6px; align-items: center; margin-top: 9px; color: var(--muted); font-size: 9px; }
.cloud-sync-dot { width: 6px; height: 6px; border-radius: 99px; background: #16a085; }
.cloud-sync-state.syncing .cloud-sync-dot { background: #d8a34f; }
.cloud-sync-state.error .cloud-sync-dot { background: #b42318; }
.cloud-logout { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; }
.cloud-logout svg { width: 15px; height: 15px; }

.cloud-local-banner {
  position: fixed;
  z-index: 9500;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(540px, calc(100% - 28px));
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid rgba(180,83,9,.22);
  border-radius: 13px;
  background: rgba(255,249,235,.96);
  box-shadow: 0 16px 40px rgba(15,23,42,.13);
  color: #74420b;
  font-size: 11px;
  backdrop-filter: blur(12px);
}
.cloud-local-banner svg { flex: 0 0 auto; width: 16px; height: 16px; }

@media (max-width: 760px) {
  .auth-gate { padding: 0; align-items: stretch; }
  .auth-shell { min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; background: #f8faf9; }
  .auth-story { min-height: 200px; padding: calc(28px + env(safe-area-inset-top)) 25px 30px; justify-content: flex-start; gap: 34px; background: #0b322c; }
  .auth-story-copy h1 { max-width: 330px; margin-bottom: 9px; font-size: 36px; }
  .auth-story-copy p { font-size: 12px; }
  .auth-points, .auth-footnote { display: none; }
  .auth-panel { align-items: flex-start; padding: 30px 24px calc(30px + env(safe-area-inset-bottom)); }
  .auth-panel h2 { font-size: 26px; }
}
