/* ─────────────────────────────────────────────────────────
   Coppre NOC — Login Page CSS
   Matches the futuristic PCB/copper theme of the dashboard
───────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --vg:     #28D880;
  --vg-lt:  rgba(40, 216, 128, .14);
  --vg-dk:  #1AAD62;
  --red:    #E85040;
  --red-lt: rgba(232, 80, 64, .14);
  --amber:  #E0A028;
  --bg:     #020204;
  --s1:     #07090F;
  --s2:     #0C0F1A;
  --s3:     #111420;
  --s4:     #161A28;
  --bd:     rgba(208, 144, 72, .13);
  --bd2:    rgba(208, 144, 72, .22);
  --bd3:    rgba(208, 144, 72, .32);
  --t1:     #E8F0FF;
  --t2:     #C0CCED;
  --t3:     #7888B8;
  --copper: #D09050;
}

html { font-size: 14px; }

body {
  font-family: 'Oxanium', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(circle, rgba(208, 144, 72, .07) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg);
  color: var(--t1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ── PCB TRACE LAYER ─────────────────────────────────────── */
.pcb-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}

/* ── MAIN WRAPPER ────────────────────────────────────────── */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* ── LOGO AREA ───────────────────────────────────────────── */
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

.login-logo-img-real {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ── CARD ────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  background: var(--s1);
  border: 0.8px solid var(--bd2);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  padding: 2rem 2rem 1.75rem;
  position: relative;
  box-shadow: 0 0 0 0.6px rgba(208, 144, 72, .14), 0 8px 40px rgba(0, 0, 0, .7);
}

/* Copper corner accents */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cline x1='14' y1='1' x2='1' y2='14' stroke='%23D09050' stroke-width='.7' opacity='.65'/%3E%3Cline x1='18' y1='1' x2='1' y2='18' stroke='%23D09050' stroke-width='.5' opacity='.38'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 2;
}

.login-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cline x1='14' y1='1' x2='1' y2='14' stroke='%23D09050' stroke-width='.7' opacity='.65'/%3E%3Cline x1='18' y1='1' x2='1' y2='18' stroke='%23D09050' stroke-width='.5' opacity='.38'/%3E%3C/svg%3E");
  transform: rotate(180deg);
  pointer-events: none;
  z-index: 2;
}

/* ── CARD HEADER ─────────────────────────────────────────── */
.card-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: .02em;
  margin-bottom: .3rem;
}

.card-subtitle {
  font-size: 11.5px;
  color: var(--t3);
}

/* ── FORM ────────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.field-input {
  background: var(--s2);
  border: 1px solid var(--bd2);
  color: var(--t1);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: .65rem .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  width: 100%;
}

.field-input::placeholder { color: var(--t3); }

.field-input:focus {
  border-color: rgba(208, 144, 72, .55);
  box-shadow: 0 0 0 2px rgba(208, 144, 72, .10);
}

.field-input.error {
  border-color: rgba(232, 80, 64, .55);
}

/* ── ERROR MESSAGE ───────────────────────────────────────── */
.error-banner {
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .6rem .9rem;
  background: var(--red-lt);
  border: 1px solid rgba(232, 80, 64, .32);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  font-size: 12px;
  color: #FF8080;
}

.error-banner.visible { display: flex; }

.error-icon {
  font-size: 14px;
  flex-shrink: 0;
  color: var(--red);
}

/* ── SUBMIT BUTTON ───────────────────────────────────────── */
.btn-login {
  margin-top: .25rem;
  width: 100%;
  padding: .75rem 1rem;
  background: rgba(208, 144, 72, .15);
  border: 1px solid rgba(208, 144, 72, .5);
  color: var(--copper);
  font-family: 'Oxanium', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background .15s, border-color .15s;
  position: relative;
  overflow: hidden;
}

.btn-login:hover:not(:disabled) {
  background: rgba(208, 144, 72, .25);
  border-color: rgba(208, 144, 72, .75);
}

.btn-login:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn-login .btn-text { transition: opacity .15s; }
.btn-login .btn-spinner { display: none; }

.btn-login.loading .btn-text { display: none; }
.btn-login.loading .btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

/* ── SPINNER DOTS ────────────────────────────────────────── */
.dots span {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--copper);
  animation: pulse-dot 1.2s infinite ease-in-out both;
}

.dots span:nth-child(1) { animation-delay: -.32s; }
.dots span:nth-child(2) { animation-delay: -.16s; }

@keyframes pulse-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: .4; }
  40%           { transform: scale(1.0); opacity: 1; }
}

/* ── FOOTER ──────────────────────────────────────────────── */
.login-footer {
  font-size: 11px;
  color: var(--t3);
  text-align: center;
  line-height: 1.6;
}

.login-footer strong { color: var(--t2); }

/* ── PULSE INDICATOR ─────────────────────────────────────── */
.sync-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--t2);
  border: 1px solid var(--bd);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  padding: 3px 9px;
}

.pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--vg);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd2); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card { padding: 1.5rem 1.25rem; }
}

/* ── LIGHT THEME ─────────────────────────────────────────── */
html[data-theme="light"] {
  --bg:  #EEF2FC;
  --s1:  #FFFFFF;
  --s2:  #F4F7FF;
  --s3:  #EAF0FF;
  --s4:  #DFE8FF;
  --bd:  rgba(160, 120, 60, .18);
  --bd2: rgba(160, 120, 60, .30);
  --bd3: rgba(140, 100, 50, .45);
  --t1:  #12192E;
  --t2:  #2E3A5A;
  --t3:  #5A6A90;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle, rgba(180, 130, 60, .09) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg);
}

html[data-theme="light"] .login-logo-img-real {
  filter: brightness(0.15);
}

