/**
 * Auth pages (login / register / lost password) — Clinicly UI.
 */

.cl-auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2.5rem;
  background: var(--cl-bg);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--cl-accent) 55%, var(--cl-bg)) 0%,
    var(--cl-bg) 42%,
    var(--cl-bg) 100%
  );
  box-sizing: border-box;
}

.cl-auth-page__wrap {
  width: 100%;
  max-width: 28rem;
}

.cl-auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.cl-auth-brand__row {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cl-auth-brand__mark {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--cl-primary), var(--cl-secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--cl-primary) 35%, transparent);
}

.cl-auth-brand__name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cl-fg);
  letter-spacing: -0.02em;
}

.cl-auth-brand__tag {
  margin: 0;
  font-size: 0.875rem;
  color: var(--cl-muted);
  line-height: 1.5;
}

.cl-auth-card {
  background: var(--cl-card);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--cl-border);
}

.cl-auth-notices {
  margin-bottom: 1rem;
}

.cl-auth-otp-gateway-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.45;
  background: color-mix(in srgb, var(--cl-accent) 12%, var(--cl-bg));
  border: 1px solid color-mix(in srgb, var(--cl-accent) 30%, var(--cl-border));
}

.cl-auth-toast-host {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cl-auth-toast-host:empty {
  display: none;
  margin-bottom: 0;
}

.cl-auth-toast {
  padding: 0.75rem 1rem;
  border-radius: var(--cl-radius, 8px);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  animation: cl-auth-toast-in 0.2s ease-out;
}

@keyframes cl-auth-toast-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cl-auth-toast--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.cl-auth-toast--success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.cl-auth-toast--info {
  background: color-mix(in srgb, var(--cl-accent) 10%, var(--cl-bg));
  border: 1px solid color-mix(in srgb, var(--cl-accent) 25%, var(--cl-border));
  color: var(--cl-text, inherit);
}

.cl-auth-field-error {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #b91c1c;
  line-height: 1.4;
}

.cl-auth-field-error--block {
  margin: 0 0 0.75rem;
}

.cl-auth-field-error[hidden] {
  display: none !important;
}

.cl-auth-input--invalid,
.cl-auth-input-wrap--invalid .woocommerce-Input {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.cl-auth-forgot-success {
  text-align: center;
  padding: 0.5rem 0 1rem;
}

.cl-auth-forgot-success__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
}

.cl-auth-forgot-success__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.cl-auth-forgot-success__text {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--cl-muted, #64748b);
}

.cl-auth-submit--ghost {
  background: transparent !important;
  color: var(--cl-accent, #0d9488) !important;
  border: 1.5px solid var(--cl-accent, #0d9488) !important;
  box-shadow: none !important;
}

.cl-auth-submit--ghost:hover {
  filter: brightness(0.95);
}

.cl-auth-notices:empty {
  display: none;
}

.cl-auth-notices .woocommerce-notices-wrapper,
.cl-auth-card .woocommerce-notices-wrapper {
  margin: 0 0 1rem;
}

.cl-auth-notices .woocommerce-notices-wrapper:last-child,
.cl-auth-card .woocommerce-notices-wrapper:last-child {
  margin-bottom: 0;
}

.cl-auth-notices .woocommerce-error,
.cl-auth-notices .woocommerce-message,
.cl-auth-notices .woocommerce-info,
.cl-auth-notices .woocommerce-notice,
.cl-auth-card .woocommerce-error,
.cl-auth-card .woocommerce-message,
.cl-auth-card .woocommerce-info,
.cl-auth-card .woocommerce-notice,
.cl-auth-card .woocommerce-notice--error,
.cl-auth-card .woocommerce-notice--success,
.cl-auth-card .woocommerce-notice--notice {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--cl-radius);
  font-size: 0.875rem;
  line-height: 1.5;
  list-style: none;
}

.cl-auth-notices ul.woocommerce-error,
.cl-auth-notices ul.woocommerce-message,
.cl-auth-card ul.woocommerce-error,
.cl-auth-card ul.woocommerce-message {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--cl-radius);
  font-size: 0.875rem;
  line-height: 1.5;
  list-style: none;
}

.cl-auth-notices ul.woocommerce-error li,
.cl-auth-notices ul.woocommerce-message li,
.cl-auth-card ul.woocommerce-error li,
.cl-auth-card ul.woocommerce-message li {
  margin: 0;
  padding: 0;
}

.cl-auth-notices ul.woocommerce-error li + li,
.cl-auth-card ul.woocommerce-error li + li {
  margin-top: 0.35rem;
}

.cl-auth-notices .woocommerce-error,
.cl-auth-notices ul.woocommerce-error,
.cl-auth-card .woocommerce-error,
.cl-auth-card ul.woocommerce-error,
.cl-auth-card .woocommerce-notice--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.cl-auth-notices .woocommerce-message,
.cl-auth-notices ul.woocommerce-message,
.cl-auth-card .woocommerce-message,
.cl-auth-card ul.woocommerce-message,
.cl-auth-card .woocommerce-notice--success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.cl-auth-notices .woocommerce-info,
.cl-auth-notices ul.woocommerce-info,
.cl-auth-card .woocommerce-info,
.cl-auth-card ul.woocommerce-info,
.cl-auth-card .woocommerce-notice--notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

#cl-auth-login-email-only[hidden],
#cl-auth-forgot-link[hidden] {
  display: none !important;
}

.cl-auth-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
  background: color-mix(in srgb, var(--cl-accent) 80%, var(--cl-bg));
  border-radius: 0.75rem;
}

.cl-auth-tab {
  flex: 1;
  border: 0;
  margin: 0;
  padding: 0.625rem 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cl-muted);
  background: transparent;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cl-auth-tab:hover {
  color: var(--cl-fg);
}

.cl-auth-tab.is-active {
  background: #fff;
  color: var(--cl-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.cl-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cl-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.cl-auth-back:hover {
  color: var(--cl-primary);
}

.cl-auth-back svg {
  flex-shrink: 0;
}

.cl-auth-forgot-visual {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  border-radius: 1rem;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--cl-primary) 18%, var(--cl-bg)),
    color-mix(in srgb, var(--cl-secondary) 22%, var(--cl-bg))
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cl-primary);
}

.cl-auth-forgot-visual svg {
  width: 1.75rem;
  height: 1.75rem;
}

.cl-auth-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cl-fg);
  text-align: center;
}

.cl-auth-card__lead {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--cl-muted);
  line-height: 1.6;
  text-align: center;
}

.cl-auth-card__lead strong {
  color: var(--cl-fg);
  font-weight: 600;
}

.cl-auth-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cl-fg);
}

.cl-auth-label__icon {
  display: flex;
  color: var(--cl-muted);
}

.cl-auth-label__icon svg {
  width: 1rem;
  height: 1rem;
}

.cl-auth-hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--cl-muted);
  line-height: 1.5;
}

.cl-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--cl-border);
  background: color-mix(in srgb, var(--cl-accent) 35%, var(--cl-bg));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cl-auth-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--cl-primary) 45%, var(--cl-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cl-primary) 12%, transparent);
}

.cl-auth-input-wrap .input-text,
.cl-auth-input-wrap input[type="text"],
.cl-auth-input-wrap input[type="email"],
.cl-auth-input-wrap input[type="tel"],
.cl-auth-input-wrap input[type="password"] {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0.75rem 1rem;
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--cl-fg);
  box-shadow: none;
  border-radius: 0.75rem;
}

.cl-auth-input-wrap--password .input-text,
.cl-auth-input-wrap--password input {
  padding-inline-end: 3rem;
}

.cl-auth-input-wrap .input-text::placeholder {
  color: var(--cl-muted);
  opacity: 0.85;
}

.cl-auth-toggle-pass {
  position: absolute;
  inset-inline-end: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  padding: 0.25rem;
  margin: 0;
  background: transparent;
  color: var(--cl-muted);
  cursor: pointer;
  border-radius: 0.375rem;
  line-height: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.cl-auth-toggle-pass:hover {
  color: var(--cl-primary);
  background: color-mix(in srgb, var(--cl-accent) 50%, transparent);
}

.cl-auth-toggle-pass svg {
  width: 1.25rem;
  height: 1.25rem;
}

.cl-auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
}

.cl-auth-link {
  color: var(--cl-primary);
  font-weight: 500;
  text-decoration: none;
}

.cl-auth-link:hover {
  text-decoration: underline;
}

.cl-auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--cl-fg);
  font-weight: 500;
}

.cl-auth-remember input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--cl-primary);
}

.cl-auth-login-form .woocommerce-form-login__submit[hidden] {
  display: none !important;
}

.cl-auth-submit,
.cl-auth-card .woocommerce-Button.button,
.cl-auth-card button.woocommerce-form-register__submit {
  width: 100%;
  margin: 0;
  padding: 1rem 1.25rem;
  border: 0;
  border-radius: 1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--cl-primary), color-mix(in srgb, var(--cl-primary) 78%, var(--cl-secondary)));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--cl-primary) 28%, transparent);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.cl-auth-submit:hover,
.cl-auth-card .woocommerce-Button.button:hover {
  filter: brightness(1.03);
}

.cl-auth-submit:active,
.cl-auth-card .woocommerce-Button.button:active {
  transform: translateY(1px);
}

.cl-auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cl-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--cl-muted);
}

.cl-auth-footer a {
  color: var(--cl-primary);
  font-weight: 600;
  text-decoration: none;
}

.cl-auth-footer a:hover {
  text-decoration: underline;
}

.cl-auth-otp-block {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px dashed var(--cl-border);
  background: color-mix(in srgb, var(--cl-accent) 25%, var(--cl-bg));
}

.cl-auth-otp-step {
  margin: 0;
}

.cl-auth-otp-lead {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--cl-muted);
}

.cl-auth-otp-digits {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.cl-auth-otp-digit {
  width: 3rem;
  height: 3.25rem;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 0.75rem;
  border: 1px solid var(--cl-border);
  background: #fff;
  color: var(--cl-fg);
  box-sizing: border-box;
}

.cl-auth-otp-digit:focus {
  outline: none;
  border-color: var(--cl-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cl-primary) 15%, transparent);
}

.cl-auth-otp-verify-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cl-auth-otp-back {
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cl-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cl-auth-otp-back:hover {
  color: var(--cl-primary);
}

.cl-auth-otp-send {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--cl-border);
  border-radius: 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cl-primary);
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cl-auth-otp-send--primary {
  margin-top: 0;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  color: #fff;
  border: 0;
  background: linear-gradient(90deg, var(--cl-primary), color-mix(in srgb, var(--cl-primary) 78%, var(--cl-secondary)));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--cl-primary) 22%, transparent);
}

.cl-auth-otp-send--primary:hover:not(:disabled) {
  filter: brightness(1.03);
}

.cl-auth-otp-send--ghost {
  margin-top: 0;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  padding: 0.5rem 0.85rem;
}

.cl-auth-otp-send:hover:not(:disabled) {
  background: var(--cl-accent);
  border-color: color-mix(in srgb, var(--cl-primary) 25%, var(--cl-border));
}

.cl-auth-otp-send:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cl-auth-otp-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--cl-muted);
}

.cl-auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--cl-muted);
  cursor: pointer;
}

.cl-auth-check input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--cl-primary);
}

.cl-auth-check a {
  color: var(--cl-primary);
  font-weight: 500;
}

.cl-auth-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--cl-muted);
  background: color-mix(in srgb, var(--cl-accent) 40%, var(--cl-bg));
  border-radius: var(--cl-radius);
  border: 1px solid var(--cl-border);
}

body.clinicly-page-auth .clinicly-header,
body.clinicly-page-auth .clinicly-footer {
  display: none;
}

body.clinicly-page-auth .clinicly-main {
  padding: 0;
  margin: 0;
  max-width: none;
  flex: 1;
  display: flex;
  flex-direction: column;
}

body.clinicly-page-auth .clinicly-site {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
