/* FCardd Identity Login — digital card system */
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Syne:wght@600;700;800&display=swap');

:root {
  --fc-ink: #0e1419;
  --fc-ink-mid: #1a242c;
  --fc-surface: #f3f5f7;
  --fc-panel: #ffffff;
  --fc-bronze: #a67c52;
  --fc-bronze-deep: #8a6540;
  --fc-bronze-soft: rgba(166, 124, 82, 0.14);
  --fc-bronze-ring: rgba(166, 124, 82, 0.28);
  --fc-text: #152028;
  --fc-muted: #5c6b76;
  --fc-border: #d5dde3;
  --fc-radius-panel: 0;
  --fc-input-height: 52px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body.identity-login-body {
  font-family: 'Figtree', Georgia, sans-serif;
  color: var(--fc-text);
  background: var(--fc-ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Full-bleed stage */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

/* Brand plane — digital card atmosphere */
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4rem);
  color: #f4f1ea;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(166, 124, 82, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(40, 90, 110, 0.25), transparent 50%),
    linear-gradient(155deg, var(--fc-ink) 0%, var(--fc-ink-mid) 55%, #122028 100%);
  overflow: hidden;
  isolation: isolate;
}

.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
  animation: fcGridDrift 28s linear infinite;
}

@keyframes fcGridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

.login-brand-top,
.login-brand-copy,
.login-brand-card-stage {
  position: relative;
  z-index: 1;
}

.login-brand-mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  animation: fcRise 0.7s ease-out both;
}

.login-brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 10px;
  padding: 0.4rem;
}

.login-brand-wordmark {
  font-family: 'Syne', 'Figtree', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
}

.login-brand-copy {
  max-width: 28rem;
  margin: 2.5rem 0 2rem;
  animation: fcRise 0.85s ease-out 0.08s both;
}

.login-brand-kicker {
  font-family: 'Figtree', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fc-bronze);
  margin: 0 0 0.85rem;
}

.login-brand-title {
  font-family: 'Syne', 'Figtree', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 0 0 1rem;
}

.login-brand-title span {
  display: block;
  color: rgba(244, 241, 234, 0.72);
  font-weight: 600;
  font-size: 0.55em;
  letter-spacing: -0.02em;
  margin-top: 0.35rem;
}

.login-brand-text {
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(244, 241, 234, 0.78);
  margin: 0;
  max-width: 22rem;
}

/* Stylized physical card */
.login-brand-card-stage {
  display: flex;
  justify-content: flex-start;
  padding-bottom: 0.5rem;
  animation: fcRise 1s ease-out 0.16s both;
}

.fc-card {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1.586 / 1;
  border-radius: 16px;
  background:
    linear-gradient(135deg, #2a3540 0%, #1a222a 45%, #12181e 100%);
  border: 1px solid rgba(255, 255, 234, 0.12);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1.35rem;
  overflow: hidden;
  transform: perspective(900px) rotateY(-8deg) rotateX(4deg);
  animation: fcCardFloat 6s ease-in-out infinite;
}

@keyframes fcCardFloat {
  0%, 100% { transform: perspective(900px) rotateY(-8deg) rotateX(4deg) translateY(0); }
  50% { transform: perspective(900px) rotateY(-5deg) rotateX(2deg) translateY(-8px); }
}

.fc-card__stripe {
  position: absolute;
  left: 0;
  right: 0;
  top: 22%;
  height: 18%;
  background: linear-gradient(90deg, #0a0d10, #2c333b 40%, #0a0d10);
}

.fc-card__stripe::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(166, 124, 82, 0.35), transparent);
  transform: translateX(-100%);
  animation: fcStripeShine 4.5s ease-in-out infinite;
}

@keyframes fcStripeShine {
  0%, 40% { transform: translateX(-100%); }
  70%, 100% { transform: translateX(100%); }
}

.fc-card__chip {
  position: absolute;
  top: 14%;
  left: 1.35rem;
  width: 38px;
  height: 28px;
  border-radius: 5px;
  background:
    linear-gradient(135deg, #d4b896, #a67c52 50%, #8a6540);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.fc-card__chip::before {
  content: '';
  position: absolute;
  inset: 6px 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.fc-card__label {
  position: absolute;
  left: 1.35rem;
  bottom: 1.2rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fc-card__hint {
  position: absolute;
  right: 1.35rem;
  bottom: 1.3rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.55);
}

/* Form column */
.login-form-col {
  background: var(--fc-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  position: relative;
}

.login-form-col::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(166, 124, 82, 0.45), transparent);
}

.login-panel {
  width: 100%;
  max-width: 400px;
  animation: fcRise 0.75s ease-out 0.12s both;
}

@keyframes fcRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card-header {
  margin-bottom: 1.75rem;
}

.login-card-header .mobile-logo {
  display: none;
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin: 0 auto 1rem;
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem;
}

.login-card-header .mobile-brand {
  display: none;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0 0 1.25rem;
  color: var(--fc-ink);
}

.login-card-header h1 {
  font-family: 'Syne', 'Figtree', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fc-text);
  margin: 0 0 0.4rem;
  line-height: 1.15;
}

.login-card-header p {
  margin: 0;
  color: var(--fc-muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.login-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--fc-text);
  margin-bottom: 0.45rem;
}

.login-field {
  margin-bottom: 1.1rem;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap > .login-input-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #7a8a96;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
}

.login-input-wrap .form-control,
.login-input-wrap input.form-control {
  height: var(--fc-input-height);
  border-radius: 8px;
  border: 1.5px solid var(--fc-border);
  padding: 0.65rem 2.75rem 0.65rem 2.75rem;
  font-size: 0.95rem;
  color: var(--fc-text);
  background: var(--fc-panel);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0;
}

.login-input-wrap .form-control::placeholder {
  color: #9aa8b2;
}

.login-input-wrap .form-control:focus {
  border-color: var(--fc-bronze);
  background: #fff;
  box-shadow: 0 0 0 3px var(--fc-bronze-ring);
  outline: none;
}

.login-password-toggle {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: #7a8a96;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  color: var(--fc-bronze-deep);
  background: var(--fc-bronze-soft);
  outline: none;
}

.login-field-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.login-field-meta .login-label {
  margin-bottom: 0;
}

.login-forgot-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--fc-bronze-deep);
  text-decoration: none;
  white-space: nowrap;
}

.login-forgot-link:hover,
.login-forgot-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.login-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.25rem 0 1.2rem;
}

.login-check .form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 1.5px solid var(--fc-border);
  border-radius: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

.login-check .form-check-input:checked {
  background-color: var(--fc-bronze);
  border-color: var(--fc-bronze);
}

.login-check .form-check-input:focus {
  box-shadow: 0 0 0 3px var(--fc-bronze-ring);
  border-color: var(--fc-bronze);
}

.login-check .form-check-label {
  font-size: 0.9rem;
  color: var(--fc-muted);
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.login-captcha {
  margin-bottom: 1.35rem;
  padding: 1rem 1.05rem;
  background: #eef1f4;
  border: 1px solid var(--fc-border);
  border-radius: 8px;
}

.login-captcha-hint {
  font-size: 0.8rem;
  color: var(--fc-muted);
  margin: 0 0 0.65rem;
}

.login-captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.login-captcha-question {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fc-text);
  min-width: 4.5rem;
  user-select: none;
}

.login-captcha-row .form-control {
  max-width: 7.5rem;
  height: 44px;
  border-radius: 8px;
  border: 1.5px solid var(--fc-border);
  background: #fff;
  padding: 0.5rem 0.75rem;
}

.login-captcha-row .form-control:focus {
  border-color: var(--fc-bronze);
  box-shadow: 0 0 0 3px var(--fc-bronze-ring);
  outline: none;
}

.login-validation,
.login-field .field-validation-error,
.login-field .text-danger,
.login-panel .validation-summary-errors,
.login-panel .text-danger {
  font-size: 0.85rem;
  display: block;
  margin-top: 0.4rem;
}

.login-panel .validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.login-submit {
  position: relative;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 8px;
  background: var(--fc-ink);
  color: #f4f1ea;
  font-family: 'Syne', 'Figtree', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.login-submit:hover:not(:disabled) {
  background: #1a242c;
  transform: translateY(-1px);
}

.login-submit:focus-visible {
  outline: 3px solid var(--fc-bronze-ring);
  outline-offset: 2px;
}

.login-submit:disabled {
  opacity: 0.85;
  cursor: not-allowed;
  transform: none;
}

.login-submit .login-btn-spinner {
  display: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}

.login-submit.is-loading .login-btn-spinner {
  display: inline-block;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

.login-footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--fc-muted);
}

/* Shared auth helpers (forgot / reset pages) */
.login-panel .form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--fc-text);
  margin-bottom: 0.45rem;
}

.login-panel .form-control {
  height: var(--fc-input-height);
  border-radius: 8px;
  border: 1.5px solid var(--fc-border);
  padding: 0.65rem 0.95rem;
  font-size: 0.95rem;
  color: var(--fc-text);
  background: var(--fc-panel);
}

.login-panel .form-control:focus {
  border-color: var(--fc-bronze);
  box-shadow: 0 0 0 3px var(--fc-bronze-ring);
  outline: none;
}

.btn-primary-rest,
.login-panel button.btn-primary-rest {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 8px;
  background: var(--fc-ink);
  color: #f4f1ea;
  font-family: 'Syne', 'Figtree', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary-rest:hover {
  background: #1a242c;
  color: #f4f1ea;
}

.auth-inline-link {
  font-weight: 600;
  color: var(--fc-bronze-deep);
  text-decoration: none;
}

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

.auth-links {
  margin-top: 1.25rem;
  text-align: center;
}

.alert-soft-rest {
  font-size: 0.9rem;
  color: var(--fc-muted);
  background: #eef1f4;
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.login-panel .brand-logo {
  display: none;
}

.login-panel .login-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
}

.login-panel .login-header p {
  color: var(--fc-muted);
  margin: 0 0 1.25rem;
}

/* Loading overlay */
body.auth-loading-active {
  overflow: hidden;
}

.auth-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-loading-overlay.is-visible {
  display: flex;
}

.auth-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 20, 25, 0.55);
}

.auth-loading-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 10px;
  padding: 1.75rem 2rem;
  text-align: center;
  max-width: 300px;
  border: 1px solid var(--fc-border);
}

.auth-loading-spinner {
  width: 2.4rem;
  height: 2.4rem;
  color: var(--fc-bronze);
  border-width: 0.2em;
}

.auth-loading-text {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  color: var(--fc-text);
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    display: none;
  }

  .login-form-col {
    min-height: 100vh;
    padding: 1.5rem 1.25rem;
  }

  .login-form-col::before {
    display: none;
  }

  .login-card-header {
    text-align: center;
  }

  .login-card-header .mobile-logo,
  .login-card-header .mobile-brand {
    display: block;
  }
}

@media (max-width: 575.98px) {
  .login-panel {
    max-width: none;
  }

  .login-field-meta {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-brand::before,
  .fc-card,
  .fc-card__stripe::after,
  .login-brand-mark,
  .login-brand-copy,
  .login-brand-card-stage,
  .login-panel,
  .login-submit {
    animation: none !important;
    transition: none;
  }

  .fc-card {
    transform: none;
  }
}
