/* EmberEdit — auth pages (login.html)
   Mirrors the Electron app's auth-card look (app/public/style.css) using the
   site's own dark/orange tokens defined in styles/site.css. */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 64px;
}

.auth-card {
  width: 380px;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 30px 26px;
  box-shadow: 0 30px 80px -20px var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-brand img { width: 34px; height: 34px; flex-shrink: 0; }
.auth-brand-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.auth-brand-name span { color: var(--accent); }

/* Status bar */
.auth-status {
  min-height: 0;
  font-size: 14.5px;
  margin-bottom: 4px;
  border-radius: 8px;
  overflow: hidden;
  transition: max-height 0.2s, padding 0.2s;
  max-height: 0;
  padding: 0 12px;
  line-height: 1.5;
}
.auth-status:not(:empty) {
  max-height: 100px;
  padding: 10px 12px;
}
.auth-status.err  { color: #ff9c8a; background: rgba(255, 156, 138, 0.08); border: 1px solid rgba(255, 156, 138, 0.2); }
.auth-status.ok   { color: #4ecb71; background: rgba(78, 203, 113, 0.08); border: 1px solid rgba(78, 203, 113, 0.2); }
.auth-status.busy { color: #ffcb6b; background: rgba(255, 203, 107, 0.08); border: 1px solid rgba(255, 203, 107, 0.2); }

/* Views */
.auth-view { display: block; }
.auth-view[hidden] { display: none; }

.auth-title {
  margin: 0 0 18px;
  font-size: 21px;
  font-weight: 700;
}
.auth-desc {
  font-size: 14.5px;
  color: var(--dim);
  margin: -8px 0 18px;
  line-height: 1.55;
}

/* Fields */
.auth-field { margin-bottom: 15px; }
.auth-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px;
  transition: border-color 0.15s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-field input::placeholder { color: var(--dim); }

.auth-terms {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--dim);
  margin: -2px 0 18px;
  cursor: pointer;
}
.auth-terms input { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }

/* Primary button */
.auth-btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 10px;
  font: 700 16px "Caudex", Georgia, serif;
  cursor: pointer;
  box-shadow: 0 10px 30px -12px rgba(255, 92, 56, 0.55);
  transition: filter 0.15s, transform 0.15s;
}
.auth-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.auth-btn-primary:active { filter: brightness(0.95); transform: none; }
.auth-btn-primary:disabled { opacity: 0.5; cursor: default; transform: none; }
.auth-btn-primary.btn-busy { opacity: 1; cursor: wait; }

.auth-sso {
  margin-top: 18px;
}
.auth-sso-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--dim);
  font-size: 14.5px;
}
.auth-sso-divider::before,
.auth-sso-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.auth-btn-google:hover {
  border-color: var(--accent);
  background: var(--panel);
}
.auth-btn-google:disabled {
  opacity: 0.5;
  cursor: default;
}
.auth-google-icon {
  flex-shrink: 0;
}
.auth-sso-terms {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 14.5px;
  line-height: 1.4;
  text-align: center;
}
.auth-sso-terms a {
  color: var(--text);
}

.auth-link.btn-busy { color: var(--accent); }
.auth-link.btn-ok { color: #7ee787; }
.auth-link.btn-err { color: #ff7b72; }

/* Footer links */
.auth-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.auth-link {
  background: none;
  border: none;
  color: var(--dim);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  padding: 4px 10px;
  margin: -4px -10px;
  border-radius: 6px;
}
.auth-link:hover { color: var(--text); text-decoration: underline; }

.auth-status-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.auth-status-link:hover { opacity: 0.8; }

/* OTP digit inputs */
.auth-otp {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 18px;
}
.auth-otp-digit {
  width: 50px;
  height: 60px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  caret-color: var(--accent);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-otp-digit:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 138, 25, 0.18);
}
.auth-otp-digit.filled { border-color: var(--accent); }

/* Hidden API base selector — opened by rapid-clicking the login logo (5×). */
.auth-brand { cursor: default; user-select: none; }
.api-env-backdrop { z-index: 220; }
.modal.api-env-modal {
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: none;
  overflow: hidden;
}
.api-env-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.api-env-header h2 { margin: 0; font-size: 18px; }
.api-env-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  font-size: 16px;
  cursor: pointer;
}
.api-env-close:hover { background: var(--panel-2); color: var(--text); }
.api-env-body { padding: 16px 20px 8px; }
.api-env-msg { margin: 0; color: var(--dim); font-size: 14.5px; line-height: 1.45; }
.api-env-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.api-env-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.api-env-option:hover,
.api-env-option:focus {
  outline: none;
  border-color: var(--accent);
}
.api-env-option[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 138, 25, 0.16);
}
.api-env-option span {
  color: var(--dim);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.api-env-current {
  margin: 14px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.api-env-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 18px;
}
.auth-btn-ghost {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.auth-btn-ghost:hover { border-color: var(--accent); }
#api-env-status.err { color: #ff7b72; }

@media (max-width: 420px) {
  .auth-otp-digit { width: 42px; height: 52px; font-size: 22px; }
  .auth-card { padding: 26px 20px 22px; }
}

/* Coming Soon gate (login.html without ?earlyaccess=1) */
.auth-coming-soon {
  width: min(420px, 100%);
  text-align: center;
  padding: 40px 32px 32px;
}
.auth-coming-soon-logo {
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}
.auth-coming-soon-logo img {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 12px 28px rgba(255, 138, 25, 0.28));
}
.auth-coming-soon-brand {
  margin: 0 0 18px;
  font-family: "Caudex", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.auth-coming-soon-brand span { color: var(--accent); }
.auth-coming-soon-title {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.auth-coming-soon-body {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--dim);
}
