/* /home/freeman/public_html/auth.css */

/* =========================
   Base & Page Shells
   ========================= */
body {
  background: #111;
  color: #eee;
  font-family: 'Segoe UI', 'DejaVu Sans Mono', Arial, sans-serif;
  padding: 18px 0 40px 0;
  margin: 0;
  min-height: 100vh;
}

h2 {
  color: #ffe678;
  font-weight: bold;
  letter-spacing: 0.01em;
  margin: 0 0 24px 0;
  text-align: center;
  font-size: 1.8em;
}

/* Auth-only container (used on login/register/reset pages) */
.auth-container {
  max-width: 400px;
  margin: 42px auto 0 auto;
  background: #181b20;
  border-radius: 16px;
  box-shadow: 0 4px 24px #000a;
  border: 1.5px solid #25314d;
  padding: 36px 36px 28px 36px;
}

/* Account wrapper exists on the account page; we scope some shared components
   to .account-wrap so auth.css can still be used site-wide safely. */
.account-wrap {
  max-width: 700px;
  margin: 60px auto 0 auto;
  background: #181b26;
  border-radius: 18px;
  box-shadow: 0 3px 24px #0007;
  padding: 32px 28px;
  border: 1.5px solid #273356;
  position: relative;
}

/* =========================
   Forms & Inputs
   ========================= */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  font-size: 1.13em;
  padding: 12px;
  background: #222c37;
  color: #ffe678;
  border: 1.2px solid #38405a;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: border-color 0.17s, background 0.17s;
  outline: none;
}
input:focus {
  border-color: #ffe678;
  background: #181d24;
}

/* In-field password toggle */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrapper input {
  width: 100%;
  padding-right: 40px; /* room for icon */
}
.toggle-password {
  position: absolute;
  right: 10px;
  cursor: pointer;
  color: #888;
  font-size: 1.1em;
}
.toggle-password:hover { color: #333; }

/* Tiny ZIP layout helper (kept for pages that only load auth.css) */
form.zip-row,
#zip-search-form {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-bottom: 0;
}
form.zip-row input[type="text"],
#zip-search-form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 220px;
  width: auto;
  margin-bottom: 0;
}
form.zip-row button[type="submit"],
#zip-search-form button[type="submit"] {
  white-space: nowrap;
  width: auto;
  margin-top: 0;
  /* push submit to the right for the ZIP row */
  margin-left: auto;
}

/* =========================
   Messages
   ========================= */
.err {
  color: #ff6961;
  background: #220c10;
  border: 1px solid #880b23;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 1.04em;
  text-align: center;
}
.succ {
  color: #85fa90;
  margin-bottom: 16px;
}

/* =========================
   Links (scoped)
   ========================= */
.auth-container a,
.auth-container a:visited,
.auth-container a:active {
  color: #7ad9ff !important;
  text-decoration: underline;
  transition: color 0.15s;
}
.auth-container a:hover {
  color: #ffe678 !important;
  text-decoration: underline;
}

.auth-links {
  margin-top: 20px;
  text-align: center;
}
.auth-container .auth-links a {
  color: #7ad9ff;
  text-decoration: none;
  margin: 0 10px;
  font-weight: 500;
}
.auth-container .auth-links a:hover {
  color: #ffe678;
  text-decoration: underline;
}

/* Ensure link text inside buttons remains readable on auth/account shells */
.auth-container .go-home-btn,
.auth-container .go-home-btn:visited,
.auth-container .go-home-btn:active,
.auth-container .upgrade-btn,
.auth-container .upgrade-btn:visited,
.auth-container .upgrade-btn:active,
.auth-container .set-home-btn,
.auth-container .set-home-btn:visited,
.auth-container .set-home-btn:active,
.auth-container .btn-yellow,
.auth-container .btn-yellow:visited,
.auth-container .btn-yellow:active,
.auth-container .share-link-btn,
.auth-container .share-link-btn:visited,
.auth-container .share-link-btn:active,
.account-wrap .go-home-btn,
.account-wrap .go-home-btn:visited,
.account-wrap .go-home-btn:active,
.account-wrap .upgrade-btn,
.account-wrap .upgrade-btn:visited,
.account-wrap .upgrade-btn:active,
.account-wrap .set-home-btn,
.account-wrap .set-home-btn:visited,
.account-wrap .set-home-btn:active,
.account-wrap .btn-yellow,
.account-wrap .btn-yellow:visited,
.account-wrap .btn-yellow:active,
.account-wrap .share-link-btn,
.account-wrap .share-link-btn:visited,
.account-wrap .share-link-btn:active {
  color: #181b26 !important;
  text-decoration: none !important;
  font-weight: 600;
}

/* Ensure Back to Map button text remains yellow even within auth-container */
.auth-container .back-to-map-btn,
.auth-container .back-to-map-btn:visited,
.auth-container .back-to-map-btn:active {
  color: #ffe678 !important;
}

/* =========================
   Buttons (shared themes)
   ========================= */
/* — Yellow is the single canonical button color now — */
.auth-container .btn-yellow,
.auth-container .share-link-btn,
.auth-container .go-home-btn,
.auth-container .upgrade-btn,
.auth-container button[type="submit"],
.auth-container .set-home-btn,
.auth-container .btn-blue,          /* force blue variants to be yellow */
.auth-container .manage-sub-btn,
.auth-container .copy-btn,
.account-wrap .btn-yellow,
.account-wrap .share-link-btn,
.account-wrap .go-home-btn,
.account-wrap .upgrade-btn,
.account-wrap button[type="submit"],
.account-wrap .set-home-btn,
.account-wrap .btn-blue,            /* force blue variants to be yellow */
.account-wrap .manage-sub-btn,
.account-wrap .copy-btn {
  background: #ffe678 !important;
  color: #181b26 !important;
  border: 1.5px solid #ffe678 !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 1.09em !important;
  line-height: 1.2 !important;
  padding: 9px 22px !important;     /* consistent height */
  box-shadow: 0 2px 8px #0003 !important;
  cursor: pointer !important;
  transition: background 0.13s, color 0.13s, border 0.13s;
  text-decoration: none !important;
  display: inline-block;
}
.auth-container .btn-yellow:hover,
.auth-container .share-link-btn:hover,
.auth-container .go-home-btn:hover,
.auth-container .upgrade-btn:hover,
.auth-container button[type="submit"]:hover,
.auth-container .set-home-btn:hover,
.auth-container .btn-blue:hover,
.auth-container .manage-sub-btn:hover,
.auth-container .copy-btn:hover,
.account-wrap .btn-yellow:hover,
.account-wrap .share-link-btn:hover,
.account-wrap .go-home-btn:hover,
.account-wrap .upgrade-btn:hover,
.account-wrap button[type="submit"]:hover,
.account-wrap .set-home-btn:hover,
.account-wrap .btn-blue:hover,
.account-wrap .manage-sub-btn:hover,
.account-wrap .copy-btn:hover {
  background: #7ad9ff !important;
  color: #181b26 !important;
  border-color: #7ad9ff !important;
}

/* Destructive (kept global class but commonly used in account-wrap) */
.btn-red {
  background: #e74c3c;
  color: #fff;
  border: 1px solid #e74c3c;
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 0.98em;
  cursor: pointer;
  font-weight: 600;
}
.btn-red[disabled] { opacity: 0.5; cursor: not-allowed; }

/* =========================
   Account Page Bits (lightweight, safe here)
   ========================= */
.tier-explain {
  margin-bottom: 23px;
  padding: 14px 19px 15px 19px;
  background: #232942;
  border-radius: 8px;
  font-size: 1.08em;
}
.tier-explain .tier-title { font-weight: bold; font-size: 1.14em; }

.upgrade-box {
  background: #273356;
  color: #ffe678;
  border-radius: 8px;
  margin-top: 9px;
  padding: 13px 14px;
  font-size: 1em;
  border: 1.2px solid #ffe678;
}

.manage-sub-btn { box-shadow: 0 2px 8px #0002 !important; }

.info-row {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  align-items: center;
}
.info-label { min-width: 92px; font-weight: bold; color: #adf; }

.home-site-row {
  margin: 22px 0 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-site-row label { margin: 0; }

select {
  font-size: 1.1em;
  padding: 8px 14px;
  background: #222;
  color: #fff;
  border: 1.5px solid #38405a;
  border-radius: 7px;
  outline: none;
  transition: border 0.13s, background 0.13s;
  min-width: 160px;
}

.goto-row {
  margin-top: 20px;
  padding: 7px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.goto-label { color: #aaf; font-weight: 500; }

.go-home-btn {
  padding: 9px 22px !important;
  margin-right: 7px;
  display: inline-block;
  float: right;
}

/* --- Back to Map button --- */
.back-to-map-btn {
  position: fixed !important;
  right: 26px !important;
  bottom: 28px !important;
  z-index: 2000 !important;
  display: inline-block !important;
  padding: 15px 30px 15px 22px !important;
  background: linear-gradient(90deg, #181d29 60%, #223058 100%) !important;
  color: #ffe678 !important;
  font-size: 1.20em !important;
  font-weight: bold !important;
  border-radius: 40px 18px 18px 40px !important;
  border: 2px solid #ffe678 !important;
  box-shadow: 0 4px 28px #000a, 0 0 0 3px #7ad9ff66 !important;
  text-decoration: none !important;
  transition: background 0.18s, color 0.13s, box-shadow 0.19s, border-color 0.14s !important;
  letter-spacing: 0.03em !important;
}
.btn-yellow.back-to-map-btn {
  position: fixed !important;
  right: 26px !important;
  bottom: 28px !important;
  z-index: 2000 !important;
  display: inline-block !important;
  padding: 15px 30px 15px 22px !important;
  background: linear-gradient(90deg, #181d29 60%, #223058 100%) !important;
  color: #ffe678 !important;
  font-size: 1.20em !important;
  font-weight: bold !important;
  border-radius: 40px 18px 18px 40px !important;
  border: 2px solid #ffe678 !important;
  box-shadow: 0 4px 28px #000a, 0 0 0 3px #7ad9ff66 !important;
  text-decoration: none !important;
  transition: background 0.18s, color 0.13s, box-shadow 0.19s, border-color 0.14s !important;
  letter-spacing: 0.03em !important;
}
.back-to-map-btn:hover,
.back-to-map-btn:focus {
  background: linear-gradient(90deg, #ffe678 50%, #7ad9ff 100%) !important;
  color: #181d29 !important;
  border-color: #7ad9ff !important;
  box-shadow: 0 6px 38px #23294288, 0 0 0 3.5px #7ad9ff99 !important;
  outline: none !important;
}
.btn-yellow.back-to-map-btn:hover,
.btn-yellow.back-to-map-btn:focus {
  background: linear-gradient(90deg, #ffe678 50%, #7ad9ff 100%) !important;
  color: #181d29 !important;
  border-color: #7ad9ff !important;
  box-shadow: 0 6px 38px #23294288, 0 0 0 3.5px #7ad9ff99 !important;
  outline: none !important;
}

@media (max-width: 800px) {
  .back-to-map-btn {
    padding: 11px 19px 11px 16px !important;
    font-size: 1em !important;
    right: 12px !important;
    bottom: 12px !important;
  }
  .btn-yellow.back-to-map-btn {
    padding: 11px 19px 11px 16px !important;
    font-size: 1em !important;
    right: 12px !important;
    bottom: 12px !important;
  }
}

.site-cards-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 0;
}
.site-card {
  background: #232942;
  border-radius: 10px;
  border: 1.2px solid #38405a;
  padding: 18px 18px 12px 18px;
  box-shadow: 0 2px 10px #0002;
  margin-bottom: 0;
}
.site-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.site-card-title a {
  font-size: 1.18em;
  font-weight: bold;
  color: #ffe678 !important;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.site-card-title a:hover {
  color: #7ad9ff !important;
  text-decoration: underline;
}

.share-link-row {
  margin: 8px 0 0 0;
  font-size: 0.97em;
  color: #ffe678;
  background: #23232a;
  padding: 7px 12px;
  border-radius: 7px;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.shared-users-list { margin: 10px 0 0 0; color: #7ad9ff; font-size: 0.99em; }
.shared-users-list ul { margin: 4px 0 0 0; padding-left: 18px; }
.shared-users-list li { margin-bottom: 2px; color: #eee; }
.shared-user-name { font-weight: 500; color: #ffe678; }
.shared-user-email { color: #7ad9ff; margin-left: 4px; }
.shared-user-date { color: #aaa; font-size: 0.95em; margin-left: 7px; }

/* =========================
   Autofill fixes
   ========================= */
input:-webkit-autofill,
input:-webkit-autofill:focus,
input:-webkit-autofill:hover,
input:-webkit-autofill:active {
  background: #222c37 !important;
  color: #ffe678 !important;
  -webkit-box-shadow: 0 0 0 1000px #222c37 inset !important;
  box-shadow: 0 0 0 1000px #222c37 inset !important;
  transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
  caret-color: #ffe678;
}
input:-webkit-autofill { -webkit-text-fill-color: #ffe678 !important; }
/* Non-standard but harmless in Blink */
input:-internal-autofill-selected {
  background: #222c37 !important;
  color: #ffe678 !important;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 600px) {
  .auth-container {
    padding: 17vw 2vw 8vw 2vw;
    max-width: 97vw;
    border-radius: 10px;
  }
  .account-wrap { padding: 15px 3vw; }
  .goto-row {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .goto-label { margin-bottom: 6px; }
  .go-home-btn {
    margin: 0;
    width: 100%;
    float: none;
  }
  .site-card { padding: 12px 7vw 10px 7vw; }
  .site-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }
}

/* Backdrop */
.cf-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 2500;
}

/* Dialog container */
.cf-modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  z-index: 2510;
}
.cf-modal[hidden], .cf-modal-backdrop[hidden] { display: none !important; }

/* Single card wrapper */
.cf-modal-card {
  position: relative;
  width: min(520px, 92vw);
  background: #121826;
  color: #e6f1ff;
  border: 1px solid #2a3b5e;
  border-radius: 14px;
  box-shadow: 0 14px 48px rgba(0,0,0,.55);
  overflow: hidden;
}

/* Sections */
.cf-modal-head { padding: 14px 16px; }
.cf-modal-head h3 { margin: 0; color: #ffe678; }

.cf-modal-body { padding: 12px 16px; border-top: 1px solid #243b5e; }

.cf-modal-actions {
  padding: 12px 16px;
  border-top: 1px solid #243b5e;
  display: flex; gap: 10px; justify-content: flex-end;
}

/* Close (X) */
.cf-modal-close {
  position: absolute; top: 8px; right: 10px;
  background: transparent; border: 0; cursor: pointer;
  color: #9fb8ff; font-size: 1.6rem; line-height: 1;
}
.cf-modal-close:hover { color: #ffe678; }
