:root {
  --cf-navy: #0f2744;
  --cf-navy-deep: #0a1a2e;
  --cf-teal: #0d9488;
  --cf-teal-light: #14b8a6;
  --cf-slate: #64748b;
  --cf-border: #e2e8f0;
  --cf-bg: #f8fafc;
  --cf-white: #ffffff;
  --cf-error-bg: #fef2f2;
  --cf-error-border: #fecaca;
  --cf-error-text: #b91c1c;
  --cf-notice-bg: #ecfdf5;
  --cf-notice-border: #a7f3d0;
  --cf-notice-text: #065f46;
  --cf-radius: 12px;
  --cf-shadow: 0 24px 64px rgba(15, 39, 68, 0.08);
}

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

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cf-bg);
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

.cf-login {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr 1fr;
}

/* —— Brand panel —— */
.cf-login__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 3rem;
  background: linear-gradient(165deg, #000e28 0%, #0f2744 46%, #001933 100%);
  color: #fff;
  overflow-y: auto;
  min-height: 100vh;
}

.cf-login__brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 88% 94%, rgba(34, 197, 94, 0.16), transparent 58%),
    radial-gradient(ellipse 60% 50% at 8% 12%, rgba(20, 184, 166, 0.1), transparent 52%);
  pointer-events: none;
}

.cf-login__brand-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.cf-login__logo-link {
  display: block;
  margin-bottom: 2.25rem;
  max-width: 100%;
  line-height: 0;
}

.cf-login__logo {
  display: block;
  width: min(340px, 92vw);
  height: auto;
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35));
}

.cf-login__headline {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.cf-login__lead {
  margin: 0 0 2rem;
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.cf-login__features {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cf-login__features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.45;
}

.cf-login__feature-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.2);
  color: var(--cf-teal-light);
}

.cf-login__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cf-login__trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
}

.cf-login__brand-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 2rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cf-login__brand-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.15s;
}

.cf-login__brand-footer a:hover {
  color: var(--cf-teal-light);
}

/* —— Form panel —— */
.cf-login__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--cf-bg);
}

.cf-login__card {
  width: 100%;
  max-width: 420px;
  background: var(--cf-white);
  border: 1px solid var(--cf-border);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: var(--cf-shadow);
}

.cf-login__header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--cf-navy);
}

.cf-login__header p {
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
  color: var(--cf-slate);
}

.cf-login__notice,
.cf-login__error {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--cf-radius);
  font-size: 0.875rem;
  line-height: 1.5;
}

.cf-login__notice {
  background: var(--cf-notice-bg);
  border: 1px solid var(--cf-notice-border);
  color: var(--cf-notice-text);
}

.cf-login__error {
  background: var(--cf-error-bg);
  border: 1px solid var(--cf-error-border);
  color: var(--cf-error-text);
}

.cf-login__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cf-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--cf-navy);
  letter-spacing: 0.01em;
}

.cf-field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.cf-field__row label {
  margin-bottom: 0;
}

.cf-optional {
  font-weight: 500;
  color: var(--cf-slate);
}

.cf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cf-input-icon {
  position: absolute;
  left: 0.85rem;
  color: #94a3b8;
  pointer-events: none;
}

.cf-input-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 2.75rem 0 2.65rem;
  border: 1.5px solid var(--cf-border);
  border-radius: var(--cf-radius);
  font-family: inherit;
  font-size: 0.9375rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cf-input-wrap input::placeholder {
  color: #94a3b8;
}

.cf-input-wrap input:hover {
  border-color: #cbd5e1;
}

.cf-input-wrap input:focus {
  outline: none;
  border-color: var(--cf-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.cf-toggle-pw {
  position: absolute;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.cf-toggle-pw:hover {
  color: var(--cf-navy);
  background: #f1f5f9;
}

.cf-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--cf-slate);
  line-height: 1.45;
}

.cf-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cf-teal);
  text-decoration: none;
}

.cf-link:hover {
  text-decoration: underline;
}

.cf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 48px;
  margin-top: 0.25rem;
  border: none;
  border-radius: var(--cf-radius);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
}

.cf-btn--primary {
  background: linear-gradient(135deg, var(--cf-teal) 0%, #0f766e 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.cf-btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.cf-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.cf-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cf-btn__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cf-spin 0.7s linear infinite;
}

@keyframes cf-spin {
  to { transform: rotate(360deg); }
}

.cf-btn.is-loading .cf-btn__text { opacity: 0; }
.cf-btn.is-loading .cf-btn__spinner { display: block; position: absolute; }

.cf-login__footer {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cf-border);
  text-align: center;
}

.cf-login__footer p {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--cf-slate);
}

.cf-login__footer a {
  color: var(--cf-teal);
  font-weight: 700;
  text-decoration: none;
}

.cf-login__footer a:hover {
  text-decoration: underline;
}

.cf-login__legal {
  font-size: 0.75rem !important;
  color: #94a3b8 !important;
}

.cf-login__mobile-home {
  display: none;
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
}

.cf-login__mobile-home a {
  color: var(--cf-teal);
  font-weight: 600;
  text-decoration: none;
}

/* —— Responsive —— */
@media (max-width: 960px) {
  .cf-login {
    grid-template-columns: 1fr;
  }

  .cf-login__brand {
    padding: 2rem 1.5rem 1.5rem;
  }

  .cf-login__logo {
    width: min(280px, 86vw);
  }

  .cf-login__logo-link {
    margin-bottom: 1.5rem;
  }

  .cf-login__headline {
    font-size: 1.2rem;
  }

  .cf-login__lead,
  .cf-login__features,
  .cf-login__trust,
  .cf-login__brand-footer {
    display: none;
  }

  .cf-login__main {
    justify-content: flex-start;
    padding: 1rem 1rem 2rem;
    margin-top: 0;
  }

  .cf-login__mobile-home {
    display: block;
    order: -1;
    width: 100%;
    max-width: 420px;
    margin: 0 0 1rem;
    padding: 0.7rem 1rem;
    text-align: center;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .cf-login__mobile-home a {
    color: #0f766e;
    font-weight: 700;
  }
}

@media (max-width: 380px) {
  .cf-login__card {
    padding: 1.5rem 1.15rem;
  }
}
