/* ==========================================================================
   CDN Media Hub — Sign in
   Tokens
   ========================================================================== */
:root {
  --color-bg:            #080B12;
  --color-panel:         #0D1219;
  --color-panel-2:       #0A0E15;
  --color-card:          rgba(255, 255, 255, 0.045);
  --color-card-border:   rgba(255, 255, 255, 0.09);
  --color-border:        rgba(255, 255, 255, 0.10);
  --color-text:          #EAEDF3;
  --color-text-dim:      #8A93A6;
  --color-text-faint:    #5C6577;

  --color-accent:        #F0A93B;   /* broadcast amber */
  --color-accent-2:      #FFC670;
  --color-accent-soft:   rgba(240, 169, 59, 0.14);
  --color-accent-ring:   rgba(240, 169, 59, 0.35);

  --color-danger:        #FF6B6B;
  --color-success:       #4ADE80;

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --ease-out: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ==========================================================================
   Brand panel (left)
   ========================================================================== */
.brand-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 15% 0%, #16202E 0%, transparent 55%),
    radial-gradient(140% 120% at 100% 100%, #1A1410 0%, transparent 50%),
    linear-gradient(160deg, #0B0F17 0%, #080B12 60%, #05070B 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 72px;
  border-right: 1px solid var(--color-border);
}

.brand-panel__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.brand-panel__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 70% at 30% 40%, transparent 0%, var(--color-bg) 100%);
  pointer-events: none;
}

.brand-panel__content {
  position: relative;
  z-index: 2;
  max-width: 480px;
  animation: rise 0.8s var(--ease-out) both;
}

.brand-panel__headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 32px 0 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #C7CDDA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-panel__sub {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--color-text-dim);
  margin: 0 0 44px;
  max-width: 420px;
}

.brand-panel__stats {
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--color-border);
}

.brand-panel__stats li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--color-accent-2);
}

.stat-label {
  font-size: 12.5px;
  color: var(--color-text-faint);
}

.brand-panel__footer {
  position: relative;
  z-index: 2;
  position: absolute;
  bottom: 40px;
  left: 72px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--color-text-faint);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse-dot 2.2s ease-out infinite;
}

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ==========================================================================
   Logo
   ========================================================================== */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--color-accent);
}

.logo__mark { flex-shrink: 0; }

.logo__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.logo--mobile {
  display: none;
  margin-bottom: 22px;
}

/* ==========================================================================
   Form panel (right)
   ========================================================================== */
.form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.form-panel__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 80% 15%, rgba(240,169,59,0.06) 0%, transparent 60%),
    radial-gradient(50% 50% at 10% 90%, rgba(240,169,59,0.04) 0%, transparent 60%);
  pointer-events: none;
}

/* ==========================================================================
   Login card — glassmorphism
   ========================================================================== */
.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  padding: 40px 36px 32px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 24px 60px -20px rgba(0,0,0,0.6);
  animation: rise 0.7s var(--ease-out) both;
  animation-delay: 0.1s;
}

.login-card__header { margin-bottom: 28px; }

.login-card__header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.login-card__header p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-dim);
}

/* ==========================================================================
   Form fields
   ========================================================================== */
.field { margin-bottom: 18px; }

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-dim);
  margin-bottom: 7px;
}

.field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.field__label-row .field__label { margin-bottom: 0; }

.field__control {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.field__control:focus-within {
  border-color: var(--color-accent-ring);
  box-shadow: 0 0 0 3.5px var(--color-accent-soft);
  background: rgba(255,255,255,0.045);
}

.field__icon {
  color: var(--color-text-faint);
  margin-left: 14px;
  flex-shrink: 0;
  transition: color 0.2s var(--ease-out);
}

.field__control:focus-within .field__icon { color: var(--color-accent); }

.field__control input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 13px 14px;
}

.field__control input::placeholder { color: var(--color-text-faint); }

.field__toggle {
  background: none;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  transition: color 0.15s var(--ease-out);
}
.field__toggle:hover { color: var(--color-text); }

.field__error {
  min-height: 16px;
  font-size: 12.5px;
  color: var(--color-danger);
  margin: 6px 0 0;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.field__error.is-visible { opacity: 1; transform: translateY(0); }

.field.has-error .field__control {
  border-color: rgba(255,107,107,0.55);
}
.field.has-error .field__control:focus-within {
  box-shadow: 0 0 0 3.5px rgba(255,107,107,0.14);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

/* ==========================================================================
   Checkbox
   ========================================================================== */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--color-text-dim);
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.checkbox__box {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid var(--color-border);
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0B0E14;
  transition: all 0.15s var(--ease-out);
  flex-shrink: 0;
}
.checkbox__box svg {
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.15s var(--ease-out);
}

.checkbox input:checked + .checkbox__box {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.checkbox input:checked + .checkbox__box svg {
  opacity: 1;
  transform: scale(1);
}
.checkbox input:focus-visible + .checkbox__box {
  box-shadow: 0 0 0 3.5px var(--color-accent-soft);
}

/* ==========================================================================
   Links
   ========================================================================== */
.link {
  color: var(--color-accent-2);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s var(--ease-out);
}
.link:hover { color: var(--color-accent); text-decoration: underline; }
.link--small { font-size: 12.5px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-submit {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--color-accent-2) 0%, var(--color-accent) 100%);
  color: #1A1206;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out), filter 0.15s var(--ease-out);
  box-shadow: 0 8px 20px -8px rgba(240,169,59,0.55);
}
.btn-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3.5px var(--color-accent-soft), 0 8px 20px -8px rgba(240,169,59,0.55);
}

.btn-submit__spinner {
  display: none;
  animation: spin 0.8s linear infinite;
}

.btn-submit.is-loading .btn-submit__label { opacity: 0; }
.btn-submit.is-loading .btn-submit__spinner {
  display: block;
  position: absolute;
}
.btn-submit.is-loading { pointer-events: none; }

.btn-submit.is-success {
  background: linear-gradient(180deg, #6EE7A8 0%, #4ADE80 100%);
  box-shadow: 0 8px 20px -8px rgba(74,222,128,0.5);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 18px;
  color: var(--color-text-faint);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.btn-secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); }

.signup-hint {
  text-align: center;
  font-size: 13.5px;
  color: var(--color-text-dim);
  margin: 24px 0 0;
}

.legal-footer {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-faint);
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #12161F;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.6);
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Motion
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.shake { animation: shake 0.4s var(--ease-out); }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .page { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .logo--mobile { display: inline-flex; }
  .form-panel { min-height: 100vh; padding: 32px 20px 90px; }
}

@media (max-width: 420px) {
  .login-card { padding: 30px 22px 26px; }
  .field-row { flex-wrap: wrap; gap: 10px; }
}
