/* ============================================================
   SECW Portal — Login Page
   ============================================================ */

/* ?? Page wrapper ?? */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ????????????????????????????????????
   LEFT PANEL — dark / brand
???????????????????????????????????? */
.login-panel-left {
  background: var(--sw-dark);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.5rem;
}

/* geometric rings */
.login-panel-left::before,
.login-panel-left::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.login-panel-left::before {
  width: 520px;
  height: 520px;
  border: 1px solid rgba(0,170,255,0.09);
  top: -160px;
  right: -160px;
}
.login-panel-left::after {
  width: 300px;
  height: 300px;
  border: 1px solid rgba(0,170,255,0.06);
  top: -20px;
  right: -20px;
}

.login-ring-3 {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid rgba(0,170,255,0.05);
  top: 120px;
  right: 120px;
  pointer-events: none;
}

/* dot grid decoration */
.login-dots {
  position: absolute;
  bottom: 80px;
  left: 3.5rem;
  width: 120px;
  height: 80px;
  background-image: radial-gradient(circle, rgba(0,170,255,0.18) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
}

/* Logo */
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.login-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--sw-blue);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-mark svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.login-logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.login-logo-text span {
  color: var(--sw-accent);
}

/* Hero copy */
.login-hero {
  position: relative;
  z-index: 1;
}

.login-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sw-accent-dim);
  border: 0.5px solid rgba(0,170,255,0.25);
  color: var(--sw-accent);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--r-full);
  margin-bottom: 1.25rem;
  letter-spacing: 0.3px;
}

.login-hero-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sw-accent);
  animation: blink 2s ease-in-out infinite;
}

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

.login-hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}

.login-hero h1 em {
  font-style: normal;
  color: var(--sw-accent);
}

.login-hero p {
  color: var(--sw-dark-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 340px;
}

/* Stats */
.login-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.login-stat {
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: var(--r-md);
  padding: 14px 16px;
  transition: background var(--t-fast) var(--ease);
}

.login-stat:hover {
  background: rgba(255,255,255,0.055);
}

.login-stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sw-accent);
  line-height: 1;
}

.login-stat-label {
  font-size: 0.75rem;
  color: var(--sw-dark-muted);
  margin-top: 4px;
}

.login-footer-text {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.15);
  position: relative;
  z-index: 1;
}

/* ????????????????????????????????????
   RIGHT PANEL — form
???????????????????????????????????? */
.login-panel-right {
  background: var(--sw-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 4rem;
  position: relative;
}

/* subtle top accent line */
.login-panel-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 4rem;
  right: 4rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sw-blue) 40%, var(--sw-accent) 60%, transparent);
  opacity: 0.5;
}

.login-form-wrap {
  max-width: 380px;
  width: 100%;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sw-blue-light);
  color: var(--sw-blue-dark);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--r-full);
  border: 0.5px solid var(--sw-blue-mid);
  margin-bottom: 1.5rem;
}

.login-form-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--sw-text);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.login-form-sub {
  font-size: 0.875rem;
  color: var(--sw-text-2);
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Form fields */
.form-group {
  margin-bottom: 1.125rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sw-text-2);
  margin-bottom: 7px;
  letter-spacing: 0.1px;
}

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

.form-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sw-text-3);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color var(--t-fast);
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  background: var(--sw-surface-2);
  border: 1px solid var(--sw-border);
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  color: var(--sw-text);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.form-input::placeholder {
  color: var(--sw-text-3);
}

.form-input:hover {
  border-color: var(--sw-border-md);
  background: var(--sw-surface);
}

.form-input:focus {
  outline: none;
  border-color: var(--sw-blue);
  background: var(--sw-surface);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.10);
}

.form-input:focus + .form-input-icon,
.form-input-wrap:focus-within .form-input-icon {
  color: var(--sw-blue);
}

/* password toggle */
.form-input-wrap .pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sw-text-3);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--r-sm);
  transition: color var(--t-fast);
}

.form-input-wrap .pw-toggle:hover { color: var(--sw-text-2); }

/* remember + forgot */
.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  margin-top: -0.25rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--sw-text-2);
  user-select: none;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sw-blue);
  cursor: pointer;
}

.form-forgot {
  font-size: 0.8125rem;
  color: var(--sw-blue);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--t-fast);
}

.form-forgot:hover { color: var(--sw-blue-dark); }

/* Submit button */
.btn-login {
  width: 100%;
  height: 46px;
  background: var(--sw-blue);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.1px;
  position: relative;
  overflow: hidden;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast), transform var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.btn-login:hover {
  background: var(--sw-blue-dark);
  box-shadow: var(--shadow-blue);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-login .btn-arrow {
  transition: transform var(--t-fast) var(--ease);
}

.btn-login:hover .btn-arrow {
  transform: translateX(3px);
}

/* Divider / hint */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.25rem 0;
  color: var(--sw-text-3);
  font-size: 0.75rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sw-border);
}

.login-help {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--sw-text-3);
}

.login-help a {
  color: var(--sw-blue);
  font-weight: 500;
}

.login-help a:hover { text-decoration: underline; }

/* redirect hint */
.login-redirect-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 1.5rem;
  padding: 10px 14px;
  background: var(--sw-surface-2);
  border: 0.5px solid var(--sw-border);
  border-radius: var(--r-md);
  font-size: 0.75rem;
  color: var(--sw-text-3);
}

.redirect-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: 0.6875rem;
  font-weight: 500;
}

.chip-admin {
  background: var(--sw-blue-light);
  color: var(--sw-blue-dark);
  border: 0.5px solid var(--sw-blue-mid);
}

.chip-client {
  background: #e1f5ee;
  color: #0a5c3a;
  border: 0.5px solid #9fe1cb;
}

/* ?? Animations (page load) ?? */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-1 { animation: fadeUp 0.5s var(--ease) both; }
.anim-2 { animation: fadeUp 0.5s var(--ease) 0.08s both; }
.anim-3 { animation: fadeUp 0.5s var(--ease) 0.16s both; }
.anim-4 { animation: fadeUp 0.5s var(--ease) 0.24s both; }
.anim-5 { animation: fadeUp 0.5s var(--ease) 0.32s both; }
.anim-6 { animation: fadeUp 0.5s var(--ease) 0.40s both; }

/* ?? Alert / error ?? */
.form-alert {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--sw-down-bg);
  border: 0.5px solid rgba(163,45,45,0.2);
  color: var(--sw-down);
  font-size: 0.8125rem;
  padding: 10px 14px;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
}

.form-alert.visible { display: flex; }

/* ?? Responsive ?? */
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-panel-left { display: none; }
  .login-panel-right { padding: 2.5rem 2rem; }
  .login-panel-right::before { left: 2rem; right: 2rem; }
}

@media (max-width: 480px) {
  .login-panel-right { padding: 2rem 1.25rem; }
}
