/* ==========================================================================
   Plusmiinus — Password Gate (Salasanakysely)
   ========================================================================== */

/* Piilotetaan pääsovellus kokonaan, kunnes salasana on oikein syötetty */
html:not(.auth-authenticated) #app-container {
  display: none !important;
}

/* Piilotetaan salasanakysely heti kun selain on todennettu */
html.auth-authenticated #password-gate {
  display: none !important;
}

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #1a1f36 0%, #0b0d14 100%);
  padding: 1.25rem;
  box-sizing: border-box;
  font-family: inherit;
  overflow-y: auto;
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: #141724;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 2.25rem 2rem;
  box-sizing: border-box;
  text-align: center;
  animation: gateCardFadeIn 0.35s ease-out;
}

@keyframes gateCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gate-brand {
  margin-bottom: 1.5rem;
}

.gate-brand svg {
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.25));
}

.gate-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 0;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gate-team {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
  margin: 0.25rem 0 0 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gate-icon-lock {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 50%;
  color: #38bdf8;
}

.gate-instruction {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.gate-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.gate-input {
  width: 100%;
  height: 52px;
  padding: 0 3.25rem 0 1.25rem;
  background: #0d101a;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  font-size: 1.05rem;
  color: #ffffff;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

.gate-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
  background: #111422;
}

.gate-input.gate-input-error {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.25) !important;
  animation: gateShake 0.4s ease-in-out;
}

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

.gate-toggle-btn {
  position: absolute;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  color: #94a3b8;
  border-radius: 8px;
  transition: background 0.2s;
}

.gate-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.gate-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fca5a5;
  font-size: 0.875rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  text-align: left;
  line-height: 1.4;
}

.gate-remember {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1.25rem;
}

.gate-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.gate-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.gate-submit-btn {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
}

.gate-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
  filter: brightness(1.08);
}

.gate-submit-btn:active {
  transform: translateY(0);
}

.gate-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.gate-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.775rem;
  color: #64748b;
}

@media (max-width: 480px) {
  .gate-card {
    padding: 1.75rem 1.25rem;
    border-radius: 16px;
  }
  .gate-title {
    font-size: 1.5rem;
  }
}
