/* Styles for the sign-in, password and second factor pages (Views/Shared/_AuthLayout.cshtml)
-----------------------------------------------------------*/
:root {
  --auth-accent: #1668c7;
  --auth-accent-hover: #1257a8;
  --auth-accent-soft: #e6f0fc;
  --auth-text: #1f2933;
  --auth-muted: #5f6b7a;
  --auth-border: #d5dbe3;
  --auth-surface: #ffffff;
  --auth-ground: #eef1f5;
  --auth-error: #b42318;
  --auth-error-soft: #fef3f2;
  --auth-error-border: #f5c2bd;
  --auth-info-soft: #eff6ff;
  --auth-info-border: #bfd6f6;
  --auth-radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.auth {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--auth-text);
  background: linear-gradient(160deg, #f6f8fb 0%, var(--auth-ground) 55%, #e3e8ef 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

/* top navigation (shown when the page does not hide the menu) */
.auth-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 18px;
  padding: 14px 24px;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-nav-user {
  margin-right: auto;
}

.auth-nav-user strong {
  color: var(--auth-text);
  font-weight: 600;
}

.auth-nav a {
  color: var(--auth-accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-nav a:hover {
  text-decoration: underline;
}

/* page frame and card */
.auth-main {
  display: flex;
  justify-content: center;
  padding: 48px 16px 32px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--auth-surface);
  border: 1px solid #e3e8ef;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.08);
  padding: 36px 36px 30px;
}

.auth-card.wide {
  max-width: 520px;
}

.auth-logo {
  display: block;
  margin: 0 auto 26px;
  max-width: 160px;
  height: auto;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  letter-spacing: -0.01em;
}

.auth-card h1 + form,
.auth-card h1 + div,
.auth-card h1 + ul,
.auth-card h1 + dl {
  margin-top: 24px;
}

.auth-lead {
  margin: 0 0 24px;
  color: var(--auth-muted);
  text-align: center;
}

.auth-card p {
  margin: 0 0 16px;
}

.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--auth-muted);
  padding: 0 16px 32px;
}

/* form fields */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.auth-card .hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--auth-muted);
  text-align: center;
  word-break: break-word;
}

.field .hint {
  text-align: left;
}

.auth-card input[type=text],
.auth-card input[type=email],
.auth-card input[type=password] {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--auth-text);
  background: #fff;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.auth-card input[type=text]:hover,
.auth-card input[type=email]:hover,
.auth-card input[type=password]:hover {
  border-color: #b4bfcc;
}

.auth-card input[type=text]:focus,
.auth-card input[type=email]:focus,
.auth-card input[type=password]:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px rgba(22, 104, 199, 0.18);
}

.auth-card input.code {
  height: 56px;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 26px;
  letter-spacing: 0.35em;
  text-align: center;
  padding-left: 0.35em;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 22px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.check input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--auth-accent);
  cursor: pointer;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--auth-radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(22, 104, 199, 0.28);
}

.btn-primary {
  color: #fff;
  background: var(--auth-accent);
}

.btn-primary:hover {
  background: var(--auth-accent-hover);
}

.btn-secondary {
  color: var(--auth-text);
  background: #fff;
  border-color: var(--auth-border);
}

.btn-secondary:hover {
  background: #f6f8fb;
  border-color: #b4bfcc;
}

.btn-link {
  width: auto;
  min-height: 0;
  padding: 4px 2px;
  color: var(--auth-accent);
  background: none;
  font-weight: 600;
}

.btn-link:hover {
  text-decoration: underline;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 20px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #edf0f4;
  font-size: 14px;
}

.auth-actions form {
  margin: 0;
}

.auth-actions a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-actions a:hover {
  text-decoration: underline;
}

/* messages */
.alert,
.validation-summary-errors {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: var(--auth-radius);
  font-size: 14px;
  border: 1px solid;
}

.alert-info,
.auth-card .message {
  color: #1e3a66;
  background: var(--auth-info-soft);
  border-color: var(--auth-info-border);
}

.alert-success {
  color: #05603a;
  background: #ecfdf3;
  border-color: #abefc6;
}

.validation-summary-errors,
.alert-error {
  color: var(--auth-error);
  background: var(--auth-error-soft);
  border-color: var(--auth-error-border);
}

.validation-summary-errors > span {
  display: block;
  font-weight: 600;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 18px;
}

.validation-summary-errors > span + ul {
  margin-top: 4px;
}

.validation-summary-valid,
.field-validation-valid {
  display: none;
}

.field-validation-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--auth-error);
}

.auth-card input.input-validation-error {
  border-color: var(--auth-error);
  background: #fff;
}

.auth-card input.input-validation-error:focus {
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.15);
}

/* authenticator enrolment */
.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  padding: 20px;
  background: #f8fafc;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
}

.qr img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  image-rendering: pixelated;
}

.qr .manual {
  width: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--auth-muted);
  text-align: center;
}

.qr code {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--auth-text);
  background: #fff;
  border: 1px dashed var(--auth-border);
  border-radius: 8px;
  word-break: break-all;
  user-select: all;
}

.auth-divider {
  margin: 24px 0 18px;
  border: 0;
  border-top: 1px solid #edf0f4;
}

.requirements {
  margin: 0 0 22px;
  padding: 12px 14px 12px 32px;
  font-size: 14px;
  color: var(--auth-muted);
  background: #f8fafc;
  border-radius: var(--auth-radius);
}

.requirements code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  color: var(--auth-text);
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  color: var(--auth-accent);
  background: var(--auth-accent-soft);
}

.status-icon.success {
  color: #067647;
  background: #dcfae6;
}

.status-icon.error {
  color: var(--auth-error);
  background: #fee4e2;
}

.status-icon svg {
  width: 28px;
  height: 28px;
}

/* button groups and lists */
.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn {
  flex: 1 1 0;
}

.provider-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  overflow: hidden;
}

.link-list li + li {
  border-top: 1px solid #edf0f4;
}

.link-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--auth-text);
  font-weight: 600;
  text-decoration: none;
}

.link-list a::after {
  content: "\203A";
  font-size: 20px;
  line-height: 1;
  color: var(--auth-muted);
}

.link-list a:hover {
  color: var(--auth-accent);
  background: #f8fafc;
}

.kv {
  margin: 0 0 22px;
  padding: 4px 16px;
  background: #f8fafc;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
}

.kv dt {
  padding-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-muted);
}

.kv dd {
  margin: 2px 0 0;
  padding-bottom: 12px;
  word-break: break-word;
}

.kv dd + dt {
  border-top: 1px solid #edf0f4;
}

.kv code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 14px;
  word-break: break-all;
}

.scope-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.scope {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.scope:hover {
  border-color: #b4bfcc;
}

.scope:has(input:checked) {
  border-color: var(--auth-accent);
  background: var(--auth-accent-soft);
}

.scope input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--auth-accent);
}

.scope span {
  display: flex;
  flex-direction: column;
}

.scope small {
  font-size: 13px;
  color: var(--auth-muted);
}

@media (max-width: 480px) {
  .btn-row {
    flex-direction: column;
  }


  .auth-main {
    padding-top: 20px;
  }

  .auth-card {
    padding: 28px 20px 24px;
    border-radius: 14px;
  }

  .auth-nav {
    justify-content: center;
    padding: 12px 16px 0;
  }
}

