/* ==========================================================
   TabRight Auth -- Form Styles
   Scoped entirely within .tr-auth-wrap
   Elementor handles the page layout
   ========================================================== */

:root {
  --tr-blue:       #007CB0;
  --tr-blue-dark:  #005f86;
  --tr-blue-light: #e8f4fb;
  --tr-text:       #111827;
  --tr-muted:      #6b7280;
  --tr-border:     #e5e7eb;
  --tr-bg:         #f9fafb;
  --tr-white:      #ffffff;
  --tr-error:      #991b1b;
  --tr-error-bg:   #fee2e2;
  --tr-success:    #166534;
  --tr-success-bg: #dcfce7;
  --tr-font:       'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Wrapper ─────────────────────────────────────────── */
.tr-auth-wrap {
  font-family: var(--tr-font);
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
  padding: 34px 32px 32px;
  background: var(--tr-white);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.12);
  margin-left: 0;
  margin-right: auto;
  position: relative;
  z-index: 2;
}

.tr-auth-logo {
  display: block;
  max-height: 36px;
  width: auto;
  margin-bottom: 24px;
}

/* ── Titles ───────────────────────────────────────────── */
.tr-auth-wrap .tr-auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--tr-text);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-family: var(--tr-font);
}

.tr-auth-wrap .tr-auth-sub {
  font-size: 0.875rem;
  color: var(--tr-muted);
  margin: 0 0 24px;
  font-family: var(--tr-font);
}

/* ── Tabs ─────────────────────────────────────────────── */
.tr-auth-wrap .tr-auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--tr-border);
  padding-bottom: 0;
}

.tr-auth-wrap .tr-auth-tab {
  flex: 1;
  height: 38px;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -2px;
  background: transparent !important;
  background-color: transparent !important;
  font-family: var(--tr-font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tr-muted) !important;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0 12px;
  box-shadow: none !important;
  border-radius: 0 !important;
  outline: none !important;
  text-decoration: none !important;
  transform: none !important;
}

.tr-auth-wrap .tr-auth-tab.is-active {
  color: #007CB0 !important;
  border-bottom: 2px solid #007CB0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.tr-auth-wrap .tr-auth-tab:hover,
.tr-auth-wrap .tr-auth-tab:focus,
.tr-auth-wrap .tr-auth-tab:active {
  background: transparent !important;
  background-color: transparent !important;
  color: #007CB0 !important;
  box-shadow: none !important;
  transform: none !important;
  border-color: transparent !important;
  outline: none !important;
}

.tr-auth-wrap .tr-auth-tab.is-active:hover,
.tr-auth-wrap .tr-auth-tab.is-active:focus {
  border-bottom-color: #007CB0 !important;
}

.tr-auth-wrap .tr-auth-panel { display: none; }
.tr-auth-wrap .tr-auth-panel.is-active { display: block; }

/* ── Form ─────────────────────────────────────────────── */
.tr-auth-wrap .tr-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Fields ───────────────────────────────────────────── */
.tr-auth-wrap .tr-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tr-auth-wrap .tr-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tr-muted);
  font-family: var(--tr-font);
  display: block;
  margin: 0;
  padding: 0;
}

.tr-auth-wrap .tr-field input,
.tr-auth-wrap .tr-field select {
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--tr-border) !important;
  background: var(--tr-white) !important;
  font-family: var(--tr-font) !important;
  font-size: 0.875rem !important;
  color: var(--tr-text) !important;
  outline: none !important;
  border-radius: 6px !important;
  box-sizing: border-box;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none !important;
  transition: border-color 0.15s;
  display: block;
  margin: 0;
}

.tr-auth-wrap .tr-field input:focus,
.tr-auth-wrap .tr-field select:focus {
  border-color: var(--tr-blue) !important;
  box-shadow: 0 0 0 3px rgba(0,124,176,0.1) !important;
  outline: none !important;
}

.tr-auth-wrap .tr-field input::placeholder {
  color: #d1d5db !important;
}

.tr-auth-wrap .tr-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 32px;
}

.tr-auth-wrap .tr-field-hint {
  font-size: 0.72rem;
  color: var(--tr-muted);
  line-height: 1.4;
  font-family: var(--tr-font);
}

.tr-auth-wrap .tr-optional {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.72rem;
}

.tr-auth-wrap .tr-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tr-auth-wrap .tr-postcode-row {
  display: flex;
  gap: 8px;
}
.tr-auth-wrap .tr-postcode-row input { flex: 1; }

/* ── Options row ──────────────────────────────────────── */
.tr-auth-wrap .tr-auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-family: var(--tr-font);
}

.tr-auth-wrap .tr-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tr-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--tr-font);
}

.tr-auth-wrap .tr-remember input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--tr-blue);
  cursor: pointer;
}

.tr-auth-wrap .tr-forgot {
  font-size: 0.82rem;
  color: var(--tr-blue);
  text-decoration: none;
  font-family: var(--tr-font);
}
.tr-auth-wrap .tr-forgot:hover { text-decoration: underline; }

/* ── BUTTONS -- high specificity to beat theme/Elementor ── */
.tr-auth-wrap button.tr-btn,
.tr-auth-wrap a.tr-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 22px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  font-family: var(--tr-font) !important;
  box-sizing: border-box !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
}

.tr-auth-wrap button.tr-btn-primary,
.tr-auth-wrap a.tr-btn-primary {
  background: #007CB0 !important;
  background-color: #007CB0 !important;
  color: #ffffff !important;
  width: 100% !important;
  margin-top: 6px !important;
}

.tr-auth-wrap button.tr-btn-primary:hover,
.tr-auth-wrap a.tr-btn-primary:hover {
  background: #005f86 !important;
  background-color: #005f86 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.tr-auth-wrap button.tr-btn-primary:active,
.tr-auth-wrap a.tr-btn-primary:active {
  background: #004e6f !important;
  transform: translateY(0) !important;
}

.tr-auth-wrap button.tr-btn-primary:disabled {
  background: #94a3b8 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.tr-auth-wrap button.tr-btn-secondary {
  background: #f3f4f6 !important;
  background-color: #f3f4f6 !important;
  color: #111827 !important;
  width: 100% !important;
}
.tr-auth-wrap button.tr-btn-secondary:hover {
  background: #e5e7eb !important;
}

.tr-auth-wrap .tr-btn-sm {
  padding: 8px 14px !important;
  font-size: 0.78rem !important;
  width: auto !important;
  margin-top: 0 !important;
}

/* ── Messages ─────────────────────────────────────────── */
.tr-auth-wrap .tr-auth-message {
  font-size: 0.84rem;
  line-height: 1.5;
  display: none;
  font-family: var(--tr-font);
}
.tr-auth-wrap .tr-auth-message.tr-msg-error {
  display: block;
  background: var(--tr-error-bg);
  color: var(--tr-error);
  padding: 10px 14px;
  border-left: 3px solid var(--tr-error);
  margin-bottom: 16px;
  font-weight: 500;
  border-radius: 0 6px 6px 0;
}
.tr-auth-wrap .tr-auth-message.tr-msg-success {
  display: block;
  background: var(--tr-success-bg);
  color: var(--tr-success);
  padding: 10px 14px;
  border-left: 3px solid var(--tr-success);
  margin-bottom: 16px;
  font-weight: 500;
  border-radius: 0 6px 6px 0;
}
.tr-auth-wrap .tr-auth-message.tr-msg-info {
  display: block;
  background: var(--tr-blue-light);
  color: var(--tr-blue-dark);
  padding: 10px 14px;
  border-left: 3px solid var(--tr-blue);
  margin-bottom: 16px;
  border-radius: 0 6px 6px 0;
}

/* ── Footer ───────────────────────────────────────────── */
.tr-auth-wrap .tr-auth-footer {
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--tr-muted);
  padding-top: 16px;
  border-top: 1px solid var(--tr-border);
  font-family: var(--tr-font);
}
.tr-auth-wrap .tr-auth-footer a {
  color: var(--tr-blue);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}
.tr-auth-wrap .tr-auth-footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 820px) {
  /* On tablet and phone the login box stands on its own, centred, so it never
     overlaps a hero image sitting in the same Elementor section. */
  .tr-auth-wrap {
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 480px) {
  .tr-auth-wrap {
    padding: 24px 20px;
    margin: 16px auto;
    border-radius: 14px;
  }
  .tr-auth-wrap .tr-field-row { grid-template-columns: 1fr; }
  .tr-auth-wrap .tr-auth-title { font-size: 1.3rem; }
}

/* ── Greeting ─────────────────────────────────────────── */
.tr-auth-wrap .tr-auth-greeting {
  font-size: 2rem;
  color: var(--tr-text);
  margin: 0 0 2px;
  font-family: var(--tr-font);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tr-auth-wrap .tr-auth-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--tr-text);
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-family: var(--tr-font);
}

/* ── Custom address autocomplete dropdown ─────────────── */
.tr-places-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--tr-white);
  border: 1.5px solid var(--tr-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
  z-index: 99999;
  max-height: 280px;
  overflow-y: auto;
}

.tr-places-item {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  cursor: pointer;
  border-top: 1px solid var(--tr-border);
  transition: background 0.1s ease;
}

.tr-places-item:first-child { border-top: none; }

.tr-places-item:hover,
.tr-places-item.is-active {
  background: var(--tr-blue-light);
}

.tr-places-main {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tr-text);
  font-family: var(--tr-font);
  line-height: 1.3;
}

.tr-places-secondary {
  font-size: 0.78rem;
  color: var(--tr-muted);
  font-family: var(--tr-font);
  margin-top: 2px;
}

/* ── Postcode lookup ─────────────────────────────────── */
.tr-auth-wrap .tr-postcode-lookup-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.tr-auth-wrap .tr-postcode-lookup-row input {
  flex: 1 1 0%;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--tr-border) !important;
  background: var(--tr-white) !important;
  font-family: var(--tr-font) !important;
  font-size: 0.9rem !important;
  color: var(--tr-text) !important;
  border-radius: 6px !important;
  outline: none !important;
  box-sizing: border-box;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tr-auth-wrap .tr-postcode-find-btn {
  flex: 0 0 90px !important;
  width: 90px !important;
  max-width: 90px !important;
  padding: 0 !important;
  margin-top: 0 !important;
  height: 42px !important;
  white-space: nowrap;
}

.tr-auth-wrap .tr-postcode-results {
  margin-top: 8px;
}

.tr-auth-wrap .tr-postcode-status {
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid;
  font-family: var(--tr-font);
}
.tr-auth-wrap .tr-postcode-status--info    { background: var(--tr-blue-light); color: var(--tr-blue-dark); border-color: var(--tr-blue); }
.tr-auth-wrap .tr-postcode-status--warning { background: var(--tr-error-bg); color: var(--tr-error); border-color: var(--tr-error); }
.tr-auth-wrap .tr-postcode-status--error   { background: var(--tr-error-bg); color: var(--tr-error); border-color: var(--tr-error); }

.tr-auth-wrap .tr-postcode-list {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--tr-border);
  border-radius: 6px;
  background: var(--tr-white);
  max-height: 240px;
  overflow-y: auto;
}

.tr-auth-wrap .tr-postcode-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100% !important;
  padding: 10px 12px !important;
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--tr-border) !important;
  cursor: pointer !important;
  text-align: left !important;
  font-family: var(--tr-font) !important;
  border-radius: 0 !important;
  height: auto !important;
  margin: 0 !important;
  transition: background 0.1s ease !important;
}

.tr-auth-wrap .tr-postcode-item:first-child { border-top: none !important; }

.tr-auth-wrap .tr-postcode-item:hover {
  background: var(--tr-blue-light) !important;
}

.tr-auth-wrap .tr-postcode-item-main {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tr-text);
  line-height: 1.3;
}

.tr-auth-wrap .tr-postcode-item-secondary {
  font-size: 0.78rem;
  color: var(--tr-muted);
  margin-top: 2px;
}

/* ── Two factor step ──────────────────────────────────────────────
   Rendered in place of the username and password fields, not beside them. */
.tr-auth-hint {
  font-size: 12.5px;
  color: #6b7280;
  margin: 10px 0 0;
  line-height: 1.55;
}

.tr-auth-lead {
  font-size: 14px;
  color: #111827;
  margin: 0 0 16px;
  line-height: 1.6;
}

#tr-2fa-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  letter-spacing: 0.3em;
  text-align: center;
}

/* Stop iOS zooming on focus: inputs under 16px trigger it. The 2FA code input
   is already 20px; this covers username, password and the register fields. */
@media (max-width: 820px) {
  .tr-auth-form input,
  .tr-auth-form select,
  #tr-login-user, #tr-login-pass,
  #tr-2fa-code {
    font-size: 16px !important;
  }
}

/* ── Two factor step: brand the secondary actions ─────────────────
   The primary "Sign in" button reuses tr-btn tr-btn-primary (blue). The resend
   and start-again controls are understated text links, not the theme's default
   pink buttons they fell back to when their classes were unstyled. Scoped to
   .tr-auth-wrap to match the rest of the auth form. */
.tr-auth-wrap .tr-auth-alt {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--tr-muted);
}
.tr-auth-wrap button.tr-auth-link {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  color: #007CB0 !important;
  font: inherit !important;
  font-weight: 600 !important;
  cursor: pointer;
  text-decoration: none !important;
}
.tr-auth-wrap button.tr-auth-link:hover {
  text-decoration: underline !important;
  color: #005f86 !important;
}
.tr-auth-wrap .tr-auth-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--tr-muted);
  margin-top: 10px;
}
