/* CIDEC auth screens */
*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

.auth-page {
  --auth-brand: #1268d7;
  --auth-brand-2: #0f4fb4;
  --auth-accent: #0f9f8f;
  --auth-ink: #10233f;
  --auth-muted: #627189;
  --auth-line: #dbe5f1;
  --auth-soft: #f5f8fc;
  --auth-card: #ffffff;
  --auth-danger: #dc2626;
  --auth-success: #07815f;
  --auth-ring: rgba(18, 104, 215, .18);
  margin: 0;
  min-height: 100vh;
  font: 500 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--auth-ink);
  background:
    linear-gradient(135deg, rgba(18, 104, 215, .08), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.auth-page a {
  color: var(--auth-brand);
}

.auth-shell,
.auth-page .shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 36px);
}

.auth-grid,
.auth-page .grid {
  width: min(1060px, 100%);
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(360px, 1fr);
  overflow: hidden;
  border: 1px solid rgba(16, 35, 63, .10);
  border-radius: 8px;
  background: var(--auth-card);
  box-shadow: 0 24px 80px rgba(16, 35, 63, .14);
}

.auth-brand,
.auth-page .brand {
  position: relative;
  isolation: isolate;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 5vw, 48px);
  color: #fff;
  background: #10233f;
}

.auth-brand::before,
.auth-page .brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--auth-aside-image, none) center/cover no-repeat;
}

.auth-brand::after,
.auth-page .brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 24, 45, .74), rgba(12, 38, 72, .86)),
    linear-gradient(135deg, rgba(18, 104, 215, .35), rgba(15, 159, 143, .22));
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .25));
}

.brand-name {
  font-weight: 850;
  letter-spacing: .2px;
  color: #fff;
}

.brand-main {
  margin-top: auto;
}

.brand-main h2,
.auth-page .brand h2 {
  max-width: 11ch;
  margin: 18px 0 12px;
  color: #fff;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
  letter-spacing: 0;
}

.brand-main p,
.auth-page .brand p {
  max-width: 44ch;
  margin: 0;
  color: rgba(255, 255, 255, .82);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .10);
  font-size: 13px;
  font-weight: 700;
}

.auth-panel,
.auth-page .panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 52px);
  background: var(--auth-card);
}

.auth-panel header,
.auth-page .panel header {
  margin-bottom: 18px;
}

.auth-panel h1,
.auth-page .panel h1 {
  margin: 0 0 8px;
  color: var(--auth-ink);
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-panel .sub,
.auth-page .panel .sub {
  margin: 0;
  color: var(--auth-muted);
}

.auth-page form {
  display: grid;
  gap: 15px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--auth-ink);
  font-size: 14px;
  font-weight: 780;
}

.hint {
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 650;
}

.control {
  position: relative;
}

.control input,
.auth-page input[type="email"],
.auth-page input[type="password"],
.auth-page input[type="text"] {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  padding: 13px 46px;
  color: var(--auth-ink);
  background: #fff;
  font: 650 16px/1.35 inherit;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.control input::placeholder {
  color: #9aa7b8;
}

.control input:focus,
.auth-page input:focus {
  border-color: var(--auth-brand);
  box-shadow: 0 0 0 5px var(--auth-ring);
}

.ico {
  position: absolute;
  top: 50%;
  width: 21px;
  height: 21px;
  color: #718096;
  transform: translateY(-50%);
  pointer-events: none;
}

.ico-left {
  left: 14px;
}

.ico-right {
  right: 14px;
  pointer-events: auto;
  cursor: pointer;
}

.eye-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.eye-btn:hover,
.eye-btn:focus {
  border-color: var(--auth-line);
  background: var(--auth-soft);
  outline: 0;
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.auth-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 820;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}

.auth-page .btn-primary,
.auth-page .btn.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--auth-brand), var(--auth-brand-2));
  box-shadow: 0 12px 28px rgba(18, 104, 215, .24);
}

.auth-page .btn-primary:hover {
  filter: brightness(1.04);
}

.auth-page .btn-primary:active {
  transform: translateY(1px);
}

.auth-page .btn-secondary {
  border: 1px solid var(--auth-line);
  color: var(--auth-ink);
  background: #fff;
}

.links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 6px;
  color: var(--auth-muted);
  font-size: 14px;
  font-weight: 650;
}

.link {
  color: var(--auth-brand);
  font-weight: 760;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
}

.alert.ok {
  color: #065f46;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.alert.error {
  color: #991b1b;
  border-color: #fecaca;
  background: #fef2f2;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  color: var(--auth-muted);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(5px);
}

.modal-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 35, 63, .20);
  text-align: center;
}

.modal-card h3 {
  margin: 0 0 8px;
  color: var(--auth-ink);
  font-size: 24px;
}

.modal-card p {
  margin: 0 0 16px;
  color: var(--auth-muted);
}

.auth-card {
  width: min(560px, 100%);
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid rgba(16, 35, 63, .10);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 35, 63, .14);
  text-align: center;
}

.auth-card-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
}

.auth-card-icon.ok {
  background: var(--auth-success);
}

.auth-card-icon.err {
  background: var(--auth-danger);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.18;
}

.auth-card p {
  margin: 0 0 18px;
  color: var(--auth-muted);
}

@media (max-width: 900px) {
  .auth-grid,
  .auth-page .grid {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .auth-page .brand {
    min-height: 245px;
  }

  .brand-main h2,
  .auth-page .brand h2 {
    max-width: 16ch;
  }
}

@media (max-width: 560px) {
  .auth-shell,
  .auth-page .shell {
    padding: 0;
  }

  .auth-grid,
  .auth-page .grid {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .auth-brand,
  .auth-page .brand {
    min-height: 210px;
    padding: 22px;
  }

  .auth-panel,
  .auth-page .panel {
    padding: 24px 20px 30px;
  }

  .label {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
