/* SafarGet — top-bar account actions and auth modal */

.sg-auth-actions {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  direction: ltr;
}

html[dir="rtl"] .sg-auth-actions {
  direction: rtl;
}

.sg-auth-btn {
  appearance: none;
  -webkit-appearance: none;
  white-space: nowrap;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 11px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sg-auth-login {
  background: #ffffffba;
  border: 1px solid #cbd8d5;
  color: #173b40;
}

.sg-auth-login:hover {
  background: #eaf3f0;
}

.sg-auth-signup {
  background: #173b40;
  border: 1px solid #1c7668;
  color: #ffffff;
}

.sg-auth-signup:hover {
  background: #0f6258;
  transform: translateY(-1px);
}

.sg-auth-btn:focus-visible,
.sg-auth-account:focus-visible {
  outline: 3px solid #3ab99c;
  outline-offset: 2px;
}

.sg-auth-label-short {
  display: none;
}

.sg-auth-account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 168px;
  padding: 4px 9px 4px 4px;
  border: 1px solid #cbd8d5;
  border-radius: 999px;
  background: #ffffffba;
  color: #173b40;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

html[dir="rtl"] .sg-auth-account {
  padding: 4px 4px 4px 9px;
}

.sg-auth-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #173b40;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.sg-auth-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-auth-chevron {
  color: #6d8580;
  font-size: 9px;
}

.sg-auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 90;
  min-width: 210px;
  padding: 8px;
  border: 1px solid #d7e2df;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 44px #18343a2e;
}

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

.sg-auth-email {
  display: block;
  margin-bottom: 6px;
  padding: 6px 10px 10px;
  border-bottom: 1px solid #eef3f1;
  color: #5b716d;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-auth-logout {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b3261e;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-align: start;
}

.sg-auth-logout:hover {
  background: #fdecea;
}

/* ------------------------------------------------------------- modal */

body.sg-auth-locked {
  overflow: hidden;
}

.sg-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0b1c1a99;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sg-auth-overlay.is-open {
  opacity: 1;
}

.sg-auth-dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 26px 26px 24px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 30px 80px #0614124d;
  direction: ltr;
  transform: translateY(8px) scale(0.985);
  transition: transform 0.18s ease;
}

html[dir="rtl"] .sg-auth-dialog {
  direction: rtl;
}

.sg-auth-overlay.is-open .sg-auth-dialog {
  transform: none;
}

.sg-auth-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f1f6f4;
  color: #39534f;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.sg-auth-close:hover {
  background: #e2ece9;
}

.sg-auth-head {
  padding-inline-end: 30px;
}

.sg-auth-icon {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 6px 18px #18343a2b;
}

.sg-auth-head h2 {
  margin: 14px 0 6px;
  color: #12343a;
  font-size: 21px;
  line-height: 1.25;
}

.sg-auth-sub {
  margin: 0;
  color: #5b716d;
  font-size: 12px;
  line-height: 1.6;
}

.sg-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 18px 0 16px;
  padding: 4px;
  border-radius: 12px;
  background: #eef4f2;
}

.sg-auth-tab {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #5f7772;
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 9px 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.sg-auth-tab[aria-selected="true"] {
  background: #ffffff;
  color: #0b6b5b;
  box-shadow: 0 2px 8px #18343a1f;
}

.sg-auth-field {
  display: block;
  margin-bottom: 12px;
}

.sg-auth-field span {
  display: block;
  margin-bottom: 6px;
  color: #47615c;
  font-size: 11px;
  font-weight: 700;
}

.sg-auth-hint {
  margin: -4px 0 12px;
  color: #7d938e;
  font-size: 10.5px;
  line-height: 1.5;
}

.sg-auth-input {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d3dfdc;
  border-radius: 10px;
  background: #fbfdfc;
  color: #173b40;
  font: inherit;
  font-size: 13px;
}

.sg-auth-input:focus {
  outline: 2px solid #3ab99c;
  outline-offset: 1px;
  border-color: #3ab99c;
}

.sg-auth-code {
  direction: ltr;
  text-align: center;
  font-family: Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 10px;
  padding-inline-start: 16px;
}

.sg-auth-sent {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px dashed #b9dcd3;
  border-radius: 10px;
  background: #f4faf8;
  color: #47615c;
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
}

.sg-auth-sent span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #7d938e;
}

.sg-auth-sent strong {
  display: block;
  margin-top: 3px;
  color: #0b6b57;
  font-size: 12.5px;
  word-break: break-all;
}

.sg-auth-foot {
  margin: 0 0 12px;
  text-align: end;
}

.sg-auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: #0b8a72;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.sg-auth-link:hover {
  text-decoration: underline;
}

.sg-auth-submit {
  width: 100%;
  padding: 12px;
  border: 1px solid #1c7668;
  border-radius: 11px;
  background: #173b40;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s ease;
}

.sg-auth-submit:hover {
  background: #0f6258;
}

.sg-auth-submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

.sg-auth-msg {
  min-height: 18px;
  margin: 12px 0 0;
  color: #5b716d;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
}

.sg-auth-msg.is-error {
  color: #b3261e;
}

.sg-auth-msg.is-success {
  color: #0a7a63;
}

/* ------------------------------------------------------------- toast */

.sg-auth-toast {
  position: fixed;
  inset-inline: 0;
  bottom: 24px;
  z-index: 1300;
  width: fit-content;
  max-width: calc(100vw - 40px);
  margin: 0 auto;
  padding: 11px 18px;
  border-radius: 999px;
  background: #173b40;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 16px 40px #0614124d;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.sg-auth-toast.is-open {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------- mobile */

@media (max-width: 600px) {
  .sg-auth-btn {
    font-size: 9px;
    padding: 6px 8px;
  }

  .sg-auth-account {
    padding: 3px 7px 3px 3px;
    font-size: 9px;
  }

  html[dir="rtl"] .sg-auth-account {
    padding: 3px 3px 3px 7px;
  }

  .sg-auth-avatar {
    width: 23px;
    height: 23px;
    font-size: 10px;
  }

  .sg-auth-name {
    max-width: 68px;
  }
}

@media (max-width: 430px) {
  .top-meta {
    gap: 6px;
  }

  .sg-auth-label-full {
    display: none;
  }

  .sg-auth-label-short {
    display: inline;
  }

  .sg-auth-actions {
    gap: 4px;
  }

  .sg-auth-btn {
    font-size: 8.5px;
    padding: 5px 6px;
  }

  .site-lang-option {
    font-size: 8.5px;
    padding: 4px 6px;
  }

  .download-nav {
    min-height: 35px;
    padding-inline: 9px;
    font-size: 8.5px;
  }
}

@media (max-width: 390px) {
  .sg-auth-actions {
    gap: 4px;
  }

  .sg-auth-btn {
    font-size: 8.5px;
    padding: 5px 6px;
  }

  .sg-auth-account {
    max-width: 112px;
    font-size: 8.5px;
  }

  .sg-auth-name {
    max-width: 54px;
  }

  .sg-auth-dialog {
    padding: 22px 18px 20px;
  }
}

/* ============================================================ responsive topbar (layered) */
@media (max-width: 1200px) {
  .site-nav { display: none !important; }
  .mobile-nav-toggle { display: grid !important; }
  .brand-and-nav { gap: 0 !important; }
  .mobile-nav {
    z-index: 30;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    background: #fafcfbf7;
    border: 1px solid #d5e2dd;
    border-radius: 16px;
    gap: 3px;
    padding: 9px;
    display: grid;
    position: absolute;
    top: calc(100% + 7px);
    left: 18px;
    right: 18px;
    box-shadow: 0 18px 42px #1d3b351c;
  }
  .mobile-nav a {
    color: #35534d;
    border-radius: 10px;
    align-items: center;
    min-height: 42px;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
  }
  .mobile-nav a:hover {
    color: #0b8e75;
    background: #eaf4ef;
  }
}

@media (max-width: 980px) {
  .topbar { padding-inline: 20px !important; }
  .brand-and-nav { gap: 14px !important; }
}

@media (max-width: 700px) {
  .topbar { height: 70px !important; padding-inline: 18px !important; }
  .brand img { border-radius: 11px; width: 37px; height: 37px; }
  .brand-name { font-size: 17px; }
  .top-meta { gap: 8px; font-size: 10px; }
  .download-nav { min-height: 37px; padding-inline: 10px; font-size: 9px; }
  .download-nav svg { width: 13px; }
  .mac-tag { display: none !important; }
}

@media (max-width: 600px) {
  .brand-copy { display: none !important; }
}

@media (max-width: 430px) {
  .top-meta { gap: 6px; }
  .sg-auth-label-full { display: none; }
  .sg-auth-label-short { display: inline; }
  .sg-auth-actions { gap: 4px; }
  .sg-auth-btn { font-size: 8.5px; padding: 5px 6px; }
  .site-lang-option { font-size: 8.5px; padding: 4px 6px; }
  .download-nav { min-height: 35px; padding-inline: 9px; font-size: 8.5px; }
  .topbar { padding-inline: 14px !important; }
}

@media (max-width: 380px) {
  .download-nav { padding-inline: 8px; font-size: 0; }
  .download-nav svg { width: 14px; }
}

/* ------------------------------------------------------------- google */
.sg-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
  color: #8aa09b;
  font-size: 10px;
  font-weight: 700;
}
.sg-auth-divider::before,
.sg-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2ece9;
}
.sg-google-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
.sg-google-wrap > div { width: 100%; }

/* ------------------------------------------------------------- dashboard */
.sg-dashboard-dialog {
  width: min(520px, 100%);
}
.sg-dash-head {
  margin-bottom: 16px;
}
.sg-dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
@media (min-width: 480px) {
  .sg-dash-grid { grid-template-columns: 1fr 1fr; }
}
.sg-dash-card {
  padding: 12px 14px;
  border: 1px solid #e2ece9;
  border-radius: 12px;
  background: #f7faf9;
}
.sg-dash-label {
  display: block;
  margin-bottom: 4px;
  color: #6b807b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.sg-dash-value {
  display: block;
  color: #12343a;
  font-size: 15px;
  font-weight: 800;
  word-break: break-word;
}
.sg-dash-email { font-size: 12px; }
.sg-dash-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef4f2;
  color: #5f7772;
  font-size: 10px;
  font-weight: 800;
}
.sg-dash-badge.is-pro {
  background: #e3f4ee;
  color: #0a7a63;
}
.sg-dash-small {
  display: block;
  margin-top: 4px;
  color: #8aa09b;
  font-size: 10px;
  font-weight: 600;
}
.sg-dash-perks {
  margin-bottom: 14px;
}
.sg-dash-perks-title {
  margin: 0 0 6px;
  color: #47615c;
  font-size: 11px;
  font-weight: 800;
}
.sg-dash-perks-list {
  margin: 0;
  padding-inline-start: 18px;
  color: #5b716d;
  font-size: 11px;
  line-height: 1.7;
}
.sg-dash-actions {
  display: grid;
  gap: 8px;
}
.sg-dash-actions .sg-auth-link {
  text-align: center;
  margin-top: 4px;
}

/* ------------------------------------------------------- delete account */
.sg-dash-danger {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed #ecdcdc;
  display: grid;
  gap: 8px;
}
.sg-dash-danger-title {
  color: #b45252;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.sg-dash-delete {
  border: 1px solid rgba(201, 74, 74, .35) !important;
  background: rgba(201, 74, 74, .08) !important;
  color: #b23b3b !important;
}
.sg-dash-delete:hover {
  background: rgba(201, 74, 74, .14) !important;
  color: #9c2f2f !important;
}
.sg-delete-dialog { width: min(460px, 100%); }
.sg-delete-dialog [hidden] { display: none !important; }
.sg-delete-head { text-align: center; margin-bottom: 14px; }
.sg-delete-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #fdeceb;
  color: #c24040;
  font-size: 24px;
  font-weight: 900;
}
.sg-delete-warn {
  margin: 6px 0 0;
  color: #6b807b;
  font-size: 12px;
  line-height: 1.7;
}
.sg-delete-list {
  margin: 0 0 16px;
  padding-inline-start: 18px;
  color: #5b716d;
  font-size: 11.5px;
  line-height: 1.8;
}
.sg-delete-actions { display: grid; gap: 8px; }
.sg-auth-submit.is-danger {
  background: linear-gradient(135deg, #d24b4b, #b53434) !important;
  box-shadow: 0 10px 24px rgba(181, 52, 52, .25) !important;
}
.sg-auth-submit.is-danger:hover { filter: brightness(1.04); }
.sg-auth-submit.is-danger:disabled { opacity: .7; cursor: progress; }
.sg-delete-subtitle {
  margin: 0 0 6px;
  color: #12343a;
  font-size: 15px;
  font-weight: 800;
}
.sg-delete-sub {
  margin: 0 0 14px;
  color: #6b807b;
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
}
.sg-delete-label {
  display: block;
  margin-bottom: 6px;
  color: #47615c;
  font-size: 11px;
  font-weight: 700;
}
.sg-delete-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d5e2dd;
  border-radius: 12px;
  background: #f7faf9;
  color: #12343a;
  font-family: Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
  direction: ltr;
}
.sg-delete-input:focus {
  outline: none;
  border-color: #0b8e75;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 142, 117, .14);
}
.sg-delete-hint {
  margin: 8px 0 14px;
  color: #8aa09b;
  font-size: 10.5px;
  line-height: 1.6;
}
