/*
 * Auth step (UI 28): login / register screen from auth.js.
 * The survey page passes its own field classes (sf-input-group, sf-input, sf-next...), so only the
 * screen's frame is styled here. The chatbot uses the plain look (.rv-auth.is-plain).
 * --rv-auth-accent: the host's brand colour.
 */
.rv-auth {
  --rv-accent: var(--rv-auth-accent, var(--sf-accent, #2563eb));
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  text-align: left;
}

.rv-auth-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 2px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rv-accent) 14%, #fff);
  color: var(--rv-accent);
}

.rv-auth-title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.rv-auth-sub {
  margin: -6px 0 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
}

.rv-auth-alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.rv-auth-alert:empty {
  display: none;
}

.rv-auth-alert.is-error {
  background: #fef2f2;
  color: #b91c1c;
}

.rv-auth-alert.is-success {
  background: #f0fdf4;
  color: #15803d;
}

/* "Resend verification email", under the message when the email is registered but not verified. */
.rv-auth-resend {
  align-self: center;
  margin: -4px auto 0;
  padding: 8px 14px;
  border: 1px solid var(--rv-accent);
  border-radius: 999px;
  background: transparent;
  color: var(--rv-accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.rv-auth-resend:hover:not(:disabled) {
  background: color-mix(in srgb, var(--rv-accent) 10%, transparent);
}

.rv-auth-resend:focus-visible {
  outline: 2px solid var(--rv-accent);
  outline-offset: 2px;
}

.rv-auth-resend:disabled {
  opacity: 0.6;
  cursor: default;
}

.rv-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rv-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rv-auth-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.rv-auth-error {
  margin: 0;
  color: #dc2626;
  font-size: 13px;
}

.rv-auth-error:empty {
  display: none;
}

.rv-auth-group {
  position: relative;
  align-items: stretch;
}

.rv-auth-eye {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.rv-auth-eye:hover {
  color: var(--rv-accent);
}

.rv-auth-eye:focus-visible,
.rv-auth-link:focus-visible {
  outline: 2px solid var(--rv-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.rv-auth-submit {
  width: 100%;
  margin-top: 4px;
}

.rv-auth-switch {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  text-align: center;
}

.rv-auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--rv-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.rv-auth-link:hover:not(:disabled) {
  text-decoration: underline;
}

.rv-auth-link:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---- Plain look (chatbot) ---- */
.rv-auth.is-plain .rv-auth-group {
  display: flex;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.rv-auth.is-plain .rv-auth-group:focus-within {
  border-color: var(--rv-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rv-accent) 18%, transparent);
}

.rv-auth.is-plain .rv-auth-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  color: #94a3b8;
}

.rv-auth.is-plain .rv-auth-input {
  flex: 1;
  min-width: 0;
  padding: 0 12px 0 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.rv-auth.is-plain .rv-auth-submit {
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--rv-accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.rv-auth.is-plain .rv-auth-submit:hover:not(:disabled) {
  filter: brightness(0.94);
}

.rv-auth.is-plain .rv-auth-submit:disabled {
  opacity: 0.7;
  cursor: default;
}

.rv-auth.is-plain .rv-auth-title {
  font-size: 21px;
}

/* ---- Signed in as ... · Log out ---- */
.rv-auth-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 6px 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  color: #334155;
  font-size: 13px;
}

.rv-auth-who-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rv-auth-who-out {
  flex: none;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.rv-auth-who-out:hover {
  background: #e2e8f0;
}
