/* Tiyara account pages: login, register, forgotten, reset and change password.
   Brand colours come from the logo: navy primary, magenta secondary. */
.tya-auth {
  --tya-navy: #074f90;
  --tya-navy-dark: #053a6b;
  --tya-magenta: #e01c7c;
  --tya-gold: #f7b24e;
  --tya-ink: #1c2021;
  --tya-muted: #5f6468;
  --tya-line: #dfe3e8;
  --tya-field: #f7f8fa;
  --tya-error: #c62828;
  --tya-radius: 16px;
  font-family: 'Poppins', sans-serif;
  color: var(--tya-ink);
  padding: 32px 0 64px;
}
.tya-auth *, .tya-auth *::before, .tya-auth *::after { box-sizing: border-box; }

/* Card: brand panel + form panel */
.tya-auth-card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  max-width: 1040px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--tya-line);
  border-radius: var(--tya-radius);
  overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(7, 79, 144, .25);
}
.tya-auth-card.is-narrow { max-width: 560px; grid-template-columns: 1fr; }

.tya-auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 40px;
  color: #fff;
  background:
    radial-gradient(circle at 15% 10%, rgba(224, 28, 124, .35), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(247, 178, 78, .28), transparent 40%),
    linear-gradient(160deg, var(--tya-navy) 0%, var(--tya-navy-dark) 100%);
}
.tya-auth-logo {
  display: inline-flex;
  width: 112px;
  height: 112px;
  padding: 10px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .4);
}
.tya-auth-logo img { width: 100%; height: 100%; object-fit: contain; }
.tya-auth-aside h2 {
  margin: 24px 0 8px;
  font-family: 'Libre Baskerville', serif;
  font-size: 26px;
  line-height: 1.3;
  color: #fff;
}
.tya-auth-aside p { margin: 0; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .85); }
.tya-auth-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.tya-auth-perks li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #fff; }
.tya-auth-perks svg {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  stroke: #fff;
}

.tya-auth-main { padding: 48px; }
.tya-auth-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tya-magenta);
}
.tya-auth-main h1 {
  margin: 0 0 8px;
  font-family: 'Libre Baskerville', serif;
  font-size: 28px;
  line-height: 1.3;
  color: var(--tya-ink);
}
.tya-auth-lead { margin: 0 0 32px; font-size: 15px; line-height: 1.6; color: var(--tya-muted); }
.tya-auth-section {
  margin: 32px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--tya-line);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tya-navy);
}

/* Fields: label above input, full width, errors directly under the field */
.tya-auth .form-group,
.tya-auth .tya-field { display: block; margin: 0 0 20px; }
.tya-auth .form-group > .control-label,
.tya-auth .tya-field > label {
  display: block;
  width: auto;
  float: none;
  margin: 0 0 8px;
  padding: 0;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--tya-ink);
}
.tya-auth .form-group > [class*='col-sm-'] { width: 100%; float: none; padding: 0; }
.tya-auth .form-group.required > .control-label::after,
.tya-auth .tya-field.required > label::after { content: ' *'; color: var(--tya-magenta); }
.tya-auth .form-group.required > .control-label::before { content: none; }
.tya-auth .form-group.required > .control-label::after,
.tya-auth .tya-field.required > label::after { display: inline; position: static; margin: 0; }
.tya-auth .form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--tya-ink);
  background-color: var(--tya-field) !important;
  border: 1px solid var(--tya-line);
  border-color: var(--tya-line) !important;
  border-radius: 10px;
  box-shadow: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.tya-auth textarea.form-control { height: auto; padding: 12px 16px; }
.tya-auth .form-control::placeholder { color: #9aa0a6; }
.tya-auth .form-control:hover { border-color: #c5ccd4 !important; }
.tya-auth .form-control:focus {
  outline: none;
  background-color: #fff !important;
  border-color: var(--tya-navy) !important;
  box-shadow: 0 0 0 3px rgba(7, 79, 144, .18);
}
.tya-auth .form-control.is-invalid { border-color: var(--tya-error) !important; background-color: #fff !important; }
.tya-auth .form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, .15); }
.tya-auth .invalid-feedback,
.tya-auth .text-danger { display: none; margin-top: 6px; font-size: 13px; color: var(--tya-error); }
.tya-auth .invalid-feedback.d-block,
.tya-auth .text-danger:not(:empty) { display: block; }
.tya-auth .tya-hint { margin-top: 6px; font-size: 13px; color: var(--tya-muted); }

.tya-auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* Password with show / hide */
.tya-pass { position: relative; }
.tya-pass .form-control { padding-right: 52px; }
.tya-pass-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tya-muted);
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.tya-pass-toggle:hover { color: var(--tya-navy); background: rgba(7, 79, 144, .06); }
.tya-pass-toggle:focus-visible { outline: 2px solid var(--tya-navy); outline-offset: 2px; }
.tya-pass-toggle svg { width: 20px; height: 20px; }
.tya-pass-toggle .tya-eye-off { display: none; }
.tya-pass-toggle[aria-pressed='true'] .tya-eye { display: none; }
.tya-pass-toggle[aria-pressed='true'] .tya-eye-off { display: block; }

.tya-auth-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -4px 0 24px; }

/* Checkboxes (newsletter, agree) */
.tya-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--tya-ink);
  cursor: pointer;
}
.tya-check input[type='checkbox'] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--tya-navy);
  cursor: pointer;
}

/* Links and buttons */
.tya-auth a:not(.tya-btn) { color: var(--tya-navy); font-weight: 500; text-decoration: none; }
.tya-auth a:not(.tya-btn):hover { color: var(--tya-magenta); text-decoration: underline; }
.tya-auth a:focus-visible { outline: 2px solid var(--tya-navy); outline-offset: 2px; border-radius: 4px; }
.tya-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .1s;
}
.tya-btn:active { transform: scale(.98); }
.tya-btn:focus-visible { outline: 3px solid rgba(7, 79, 144, .35); outline-offset: 2px; }
.tya-btn-primary { background: var(--tya-navy); color: #fff; }
.tya-btn-primary:hover { background: var(--tya-navy-dark); color: #fff; }
.tya-btn-outline { background: #fff; color: var(--tya-navy); border-color: var(--tya-navy); }
.tya-btn-outline:hover { background: rgba(7, 79, 144, .06); color: var(--tya-navy); }
.tya-btn[disabled], .tya-btn.disabled { opacity: .7; cursor: wait; }

.tya-auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0 16px;
  font-size: 13px;
  color: var(--tya-muted);
}
.tya-auth-divider::before, .tya-auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--tya-line); }
.tya-auth-foot { margin: 24px 0 0; font-size: 14px; text-align: center; color: var(--tya-muted); }

.tya-auth .alert { margin: 0 0 24px; border-radius: 10px; font-size: 14px; }

/* Change password sits inside the account area next to the account menu */
.tya-auth.is-account { padding: 0 0 48px; }
.tya-auth.is-account .tya-auth-card { max-width: 640px; margin: 0; }
.tya-auth.is-account .tya-auth-main { padding: 40px; }

/* Page chrome on these routes */
html[class*='route-account-login'] .page-title,
html[class*='route-account-register'] .page-title,
html[class*='route-account-forgotten'] .page-title,
html[class*='route-account-password'] .page-title { display: none; }

@media (max-width: 900px) {
  .tya-auth-card { grid-template-columns: 1fr; }
  .tya-auth-aside { padding: 32px 24px; gap: 20px; }
  .tya-auth-aside .tya-auth-perks { display: none; }
  .tya-auth-aside h2 { font-size: 22px; margin-top: 16px; }
  .tya-auth-logo { width: 80px; height: 80px; padding: 8px; border-radius: 16px; }
  .tya-auth-main { padding: 32px 24px; }
}
@media (max-width: 480px) {
  .tya-auth { padding: 16px 0 48px; }
  .tya-auth-card { border-radius: 12px; }
  .tya-auth-row { grid-template-columns: 1fr; }
  .tya-auth-main h1 { font-size: 24px; }
  .tya-auth.is-account .tya-auth-main { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .tya-auth *, .tya-auth *::before, .tya-auth *::after { transition: none !important; }
}

/* Journal3 overrides: even field spacing, always show required marks, spaced checkboxes */
.tya-auth .form-group,
.tya-auth .tya-field { margin-top: 0 !important; }
.tya-auth .form-group.required > .control-label::after,
.tya-auth .tya-field.required > label::after { display: inline !important; font-size: inherit; color: var(--tya-magenta); }
.tya-auth label.tya-check { margin: 0 0 14px !important; }
.tya-auth label.tya-check + button,
.tya-auth label.tya-check + .tya-btn { margin-top: 12px !important; }
#account-register.tya-auth #account .form-group.required > .control-label::after { display: inline !important; content: ' *'; }
#account-register.tya-auth #account { gap: 0 !important; margin: 0 !important; padding: 0 !important; }
/* 16px stops iOS zooming into fields on focus */
.tya-auth .form-control { font-size: 16px !important; }
@media (max-width: 480px) {
  .tya-auth-aside { flex-direction: row; align-items: center; padding: 20px; }
  .tya-auth-aside > div { display: flex; align-items: center; gap: 16px; }
  .tya-auth-aside p { display: none; }
  .tya-auth-aside h2 { margin: 0; font-size: 18px; }
  .tya-auth-logo { width: 64px; height: 64px; padding: 6px; border-radius: 14px; }
}
/* Login / register popups: the popup frame is the card */
html.popup .tya-auth { padding: 0; }
html.popup .tya-auth-card { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
html.popup .tya-auth-main { padding: 24px; }
html.popup .breadcrumbs,
html.popup .npd-whatsapp-float { display: none !important; }

/* Loading state: Journal's Bootstrap 3 $.fn.button swaps in data-loading-text */
.tya-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tya-spin .7s linear infinite;
}
.tya-btn-outline .tya-spinner { border-color: rgba(7, 79, 144, .25); border-top-color: var(--tya-navy); }
.tya-btn.disabled, .tya-btn[disabled] { opacity: .85; cursor: progress; }
@keyframes tya-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tya-spinner { animation-duration: 1.6s; } }

/* Journal's $.fn.button / $.fn.jbutton only add .disabled while a request
   runs, so draw the spinner from that state. */
.tya-btn { position: relative; }
.tya-btn.disabled > *,
.tya-btn[disabled] > * { visibility: hidden; }
.tya-btn.disabled::after,
.tya-btn[disabled]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tya-spin .7s linear infinite;
}
.tya-btn-outline.disabled::after,
.tya-btn-outline[disabled]::after { border-color: rgba(7, 79, 144, .25); border-top-color: var(--tya-navy); }
