/**
 * Password Protection Overlay
 * - Full-screen overlay to protect website access
 * - Session-based (expires when browser closes)
 */

/* Overlay backdrop */
.password-protection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(var(--text-body-rgb, 177, 22, 22), 0.95) 0%,
    rgba(var(--text-body-rgb, 177, 22, 22), 0.98) 100%
  );
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Hidden state */
.password-protection-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Lock container */
.password-lock-container {
  background: var(--surface-surface, #FFF);
  border-radius: var(--radius-lg, 24px);
  padding: var(--padding-padding-xxl, 48px);
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px 0 rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Lock icon */
.password-lock-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--gap-gap-lg, 24px);
  background: rgba(var(--text-body-rgb, 177, 22, 22), 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-body);
}

.password-lock-icon svg {
  width: 40px;
  height: 40px;
}

/* Title and subtitle */
.password-lock-title {
  color: var(--surface-on-surface, #000);
  font-family: var(--font-family, Dubai);
  font-size: var(--font-size-h4, 28px);
  font-weight: 700;
  line-height: var(--line-height-h4, 36px);
  margin: 0 0 var(--gap-gap-sm, 8px) 0;
}

.password-lock-subtitle {
  color: var(--surface-on-surface-variant, #4B4545);
  font-family: var(--font-family, Dubai);
  font-size: var(--font-size-body, 16px);
  font-weight: 400;
  line-height: var(--line-height-body, 24px);
  margin: 0 0 var(--gap-gap-xxl, 32px) 0;
}

/* Password form */
.password-form {
  display: flex;
  flex-direction: column;
  gap: var(--gap-gap-lg, 16px);
}

.password-input-wrapper {
  position: relative;
}

.password-input {
  width: 100%;
  padding: var(--padding-padding-md, 16px) var(--padding-padding-lg, 20px);
  border: 2px solid var(--surface-outline, #E4E2E6);
  border-radius: var(--radius-md, 12px);
  font-family: var(--font-family, Dubai);
  font-size: var(--font-size-body, 16px);
  line-height: var(--line-height-body, 24px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--surface-surface, #FFF);
  color: var(--surface-on-surface, #000);
}

.password-input:focus {
  outline: none;
  border-color: var(--text-body);
  box-shadow: 0 0 0 4px rgba(var(--text-body-rgb, 177, 22, 22), 0.1);
}

.password-input.error {
  border-color: #dc2626;
}

/* Error message */
.password-error {
  display: none;
  color: #dc2626;
  font-family: var(--font-family, Dubai);
  font-size: var(--font-size-caption, 14px);
  font-weight: 500;
  line-height: var(--line-height-caption, 20px);
  margin-top: -8px;
  text-align: start;
}

.password-error.show {
  display: block;
}

/* Submit button */
.password-submit-btn {
  width: 100%;
  padding: var(--padding-padding-md, 16px) var(--padding-padding-xl, 24px);
  background: var(--text-body);
  color: var(--surface-surface, #FFF);
  border: none;
  border-radius: var(--radius-md, 12px);
  font-family: var(--font-family, Dubai);
  font-size: var(--font-size-body, 16px);
  font-weight: 600;
  line-height: var(--line-height-body, 24px);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.password-submit-btn:hover {
  background: rgba(var(--text-body-rgb, 177, 22, 22), 0.9);
  transform: translateY(-1px);
}

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

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

/* Loading spinner */
.password-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.password-submit-btn.loading .password-spinner {
  display: block;
}

.password-submit-btn.loading .btn-text {
  display: none;
}

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

/* Footer */
.password-footer {
  margin-top: var(--gap-gap-xxl, 32px);
  padding-top: var(--gap-gap-lg, 20px);
  border-top: 1px solid var(--surface-outline, #E4E2E6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-gap-sm, 8px);
}

.password-footer-text {
  color: var(--surface-on-surface-variant, #4B4545);
  font-family: var(--font-family, Dubai);
  font-size: var(--font-size-caption, 14px);
  font-weight: 400;
  line-height: var(--line-height-caption, 20px);
  text-align: center;
}

.password-footer-logo {
  display: block;
  transition: opacity 0.2s ease;
}

.password-footer-logo:hover {
  opacity: 0.8;
}

.password-footer-logo:focus {
  outline: 2px solid var(--text-body);
  outline-offset: 4px;
  border-radius: 4px;
}

.password-footer-logo img {
  height: 32px;
  width: auto;
  display: block;
}

/* Responsive */
@media (max-width: 640px) {
  .password-lock-container {
    padding: var(--padding-padding-xl, 32px) var(--padding-padding-lg, 24px);
  }

  .password-lock-icon {
    width: 64px;
    height: 64px;
  }

  .password-lock-icon svg {
    width: 32px;
    height: 32px;
  }

  .password-lock-title {
    font-size: var(--font-size-h5, 24px);
    line-height: var(--line-height-h5, 32px);
  }

  .password-footer {
    margin-top: var(--gap-gap-lg, 24px);
    padding-top: var(--gap-gap-md, 16px);
  }

  .password-footer-text {
    font-size: 13px;
  }

  .password-footer-logo img {
    height: 28px;
  }
}
