/* Auth + subscription UI styles. Layered on top of existing styles.css so the
   journal app's look stays the same. */

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.auth-modal[hidden] { display: none; }

.auth-modal-shell {
  background: #fff;
  border-radius: 16px;
  width: min(440px, 100%);
  padding: 24px clamp(20px, 4vw, 28px);
  box-shadow: 0 30px 60px rgba(15, 25, 23, 0.35);
  position: relative;
  max-height: calc(100vh - 40px);
}

.auth-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  color: #5e6863;
  font-size: 1.6rem;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  cursor: pointer;
}
.auth-close:hover { color: #1a1a1a; }

.auth-title {
  margin: 0 0 6px;
  font-size: 1.4rem;
  color: #1f2f2b;
}
.auth-subtitle {
  margin: 0 0 14px;
  color: #5e6863;
  font-size: 0.92rem;
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: #eef1ea;
  border-radius: 10px;
  padding: 4px;
  margin: 0 0 16px;
}
.auth-tabs[hidden] { display: none; }
.auth-tab {
  flex: 1;
  background: transparent;
  border: 0;
  border-radius: 7px;
  padding: 9px 12px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2f2b;
  cursor: pointer;
  min-height: 40px;
}
.auth-tab.is-active {
  background: #fff;
  color: #17635e;
  box-shadow: 0 1px 3px rgba(15, 25, 23, 0.12);
}
.auth-tab:hover:not(.is-active) {
  color: #17635e;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form[hidden] { display: none; }
.auth-subtitle[hidden] { display: none; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #1f2f2b;
  font-size: 0.92rem;
}
.auth-form input {
  border: 1px solid #d6ddd0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  background: #fff;
  color: #1a1a1a;
  font-weight: 400;
}
.auth-form input:focus {
  outline: 2px solid #17635e;
  outline-offset: 1px;
  border-color: #17635e;
}
.auth-form button[type="submit"] {
  margin-top: 4px;
  background: #17635e;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  min-height: 46px;
}
.auth-form button[type="submit"]:hover { filter: brightness(0.94); }

.auth-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.auth-links-center {
  justify-content: center;
}
.auth-inline-link {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}
.auth-link {
  background: transparent;
  border: 0;
  color: #17635e;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  font-size: 0.92rem;
  min-height: auto;
}
.auth-link-small {
  font-weight: 500;
  font-size: 0.85rem;
  color: #5e6863;
}
.auth-link:hover { text-decoration: underline; }
.auth-link-small:hover { color: #17635e; }

.auth-error,
.auth-success {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.92rem;
  margin-bottom: 14px;
}
.auth-error { background: #fbecec; border: 1px solid #e9b8b8; color: #8a2e2e; }
.auth-success { background: #e3eceb; border: 1px solid #c2d6d3; color: #16433f; }

.auth-help {
  color: #5e6863;
  margin: 0 0 4px;
  font-size: 0.92rem;
}
.auth-help-note { margin-top: 14px; }

.locked-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.locked-actions button {
  flex: 1 1 140px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  background: #17635e;
  color: #fff;
  min-height: 44px;
}
.locked-actions button.ghost {
  background: #eef1ea;
  color: #1a1a1a;
  border: 1px solid #d6ddd0;
}

body.auth-modal-open { overflow: hidden; }

/* Topbar account chip */
.topbar-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-account .account-status {
  font-size: 0.85rem;
  color: #5e6863;
  display: none;
}
@media (min-width: 720px) {
  .topbar-account .account-status { display: inline; }
}
.topbar-account button { min-height: 38px; padding: 0 14px; }

/* Locked nav items */
.nav-item.is-locked,
.shortcut.is-locked {
  position: relative;
}
.nav-item.is-locked::after,
.shortcut.is-locked::after {
  content: "🔒";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.85;
}
.nav-item.is-locked,
.shortcut.is-locked {
  opacity: 0.85;
}

/* Billing view */
#billing .billing-grid {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}
#billing .billing-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #d6ddd0;
  border-radius: 10px;
}
#billing .billing-row dt {
  margin: 0;
  font-weight: 600;
  color: #1f2f2b;
}
#billing .billing-row dd {
  margin: 0;
  color: #1a1a1a;
  text-align: right;
}
#billing .billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
#billing .billing-actions button { min-height: 44px; padding: 0 18px; }
#billing .billing-actions .ghost {
  background: #eef1ea;
  color: #1a1a1a;
  border: 1px solid #d6ddd0;
}
#billing .billing-actions .danger {
  background: #fff;
  color: #a43d3d;
  border: 1px solid #a43d3d;
}
#billing .billing-actions .danger:hover {
  background: #fbecec;
}
#billing .billing-status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #e3eceb;
  color: #16433f;
}
#billing .billing-status-pill.warn {
  background: #fbecdf;
  color: #8a4a1f;
}
#billing .billing-status-pill.bad {
  background: #fbecec;
  color: #8a2e2e;
}
#billing .billing-callout {
  background: #fff;
  border: 1px solid #d6ddd0;
  border-left: 4px solid #17635e;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 0.95rem;
  color: #1a1a1a;
}
#billing .billing-empty {
  background: #fff;
  border: 1px dashed #d6ddd0;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  color: #5e6863;
}
