/* ========================================
   Components — Password Gate + Login Overlay (v2)
   ======================================== */

/* ---- Password Gate ---- */
#password-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  transition: opacity 500ms ease;
}

#password-gate.dismissed {
  opacity: 0;
  pointer-events: none;
}

.gate-card {
  width: 380px;
  padding: 44px 36px 36px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gate-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 2px;
  margin-top: 8px;
}

.gate-card > p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

#gate-password {
  width: 100%;
  height: 48px;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--text-primary);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

#gate-password:focus {
  border-color: var(--core-accent);
  box-shadow: 0 0 0 3px var(--core-accent-dim);
}

#gate-submit {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--core-accent), var(--sony-purple));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 4px;
  transition: filter 150ms ease;
}

#gate-submit:hover {
  filter: brightness(1.1);
}

#gate-error {
  font-size: 13px;
  color: #e74c4c;
  margin-top: 4px;
}

#gate-error.hidden {
  display: none;
}

@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-10px); }
  40%  { transform: translateX(10px); }
  60%  { transform: translateX(-6px); }
  80%  { transform: translateX(6px); }
}

#password-gate.shake .gate-card {
  animation: gateShake 400ms ease;
}

/* ---- Login Overlay ---- */
#login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
}

#login-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.login-card {
  width: 420px;
  padding: 48px 40px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  text-align: center;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-logo .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}

.login-logo .logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.login-logo .logo-text {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 2px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--core-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 36px;
}

.login-field {
  text-align: left;
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.login-input {
  width: 100%;
  height: 48px;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  position: relative;
  font-family: var(--font-body);
  overflow: hidden;
}

.login-input .input-text {
  white-space: nowrap;
}

.login-input .input-cursor {
  display: none;
  width: 2px;
  height: 18px;
  background: var(--core-accent);
  animation: cursorBlink 1s step-end infinite;
  margin-left: 1px;
  flex-shrink: 0;
}

.login-input.focused {
  border-color: var(--core-accent);
  box-shadow: 0 0 0 3px var(--core-accent-dim);
}

.login-input.focused .input-cursor {
  display: inline-block;
}

.password-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.password-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-primary);
}

.login-btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--core-accent), var(--sony-purple));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.login-btn:hover {
  filter: brightness(1.1);
}

.login-btn .login-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

.login-btn.loading .login-text {
  display: none;
}

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

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  justify-content: center;
}

.login-remember .checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.login-remember .checkbox.checked {
  background: var(--core-accent);
  border-color: var(--core-accent);
  position: relative;
}

.login-remember .checkbox.checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.login-remember span {
  font-size: 13px;
  color: var(--text-secondary);
}
