/* ============================================
   Base Styles
   ============================================ */

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #1a1a1a;
  color: #e0e0e0;
}

/* ============================================
   Iframe Status Display
   ============================================ */

.enclave-status {
  max-width: 600px;
  margin: 40px auto;
  padding: 30px;
  background: #2a2a2a;
  border-radius: 8px;
  border: 1px solid #3a3a3a;
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #3a3a3a;
}

.logo {
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
}

h1 {
  margin: 0;
  font-size: 24px;
  color: #4CAF50;
  font-weight: 600;
}

.hash {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  background: #1a1a1a;
  padding: 10px;
  border-radius: 4px;
  word-break: break-all;
  color: #888;
  margin: 10px 0;
}

.status {
  color: #4CAF50;
  font-weight: 600;
}

.description {
  font-size: 14px;
  color: #888;
  margin-top: 20px;
}

.verification-badge {
  margin: 16px 0;
  text-align: center;
}

.verification-badge a {
  display: inline-block;
  transition: opacity 0.2s;
}

.verification-badge a:hover {
  opacity: 0.8;
}

.verification-badge img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   KMS Modal Styles (for popup windows)
   ============================================ */

.kms-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: kms-modal-fade-in 0.2s ease-out;
}

@keyframes kms-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.kms-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.kms-modal-content {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 450px;
  padding: 0;
  animation: kms-modal-slide-up 0.3s ease-out;
}

@keyframes kms-modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kms-modal-header {
  padding: 2rem 2rem 1rem 2rem;
  border-bottom: 1px solid #333;
}

.kms-modal-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: #fff;
  font-weight: 600;
}

.kms-modal-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: #888;
}

.kms-modal-body {
  padding: 2rem;
}

.kms-auth-option {
  margin-bottom: 1.5rem;
}

.kms-auth-option form {
  margin: 0;
  padding: 0;
}

/* Hidden username field for password managers */
.kms-hidden-username {
  display: none !important;
  visibility: hidden;
  position: absolute;
  left: -9999px;
}

.kms-auth-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.kms-auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kms-auth-btn:active {
  transform: translateY(0);
}

.kms-auth-btn.kms-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.kms-auth-btn.kms-primary:hover {
  background: linear-gradient(135deg, #7a8ff0 0%, #8a5bb2 100%);
}

.kms-auth-btn.kms-secondary {
  background: #2d3748;
  color: #fff;
  border: 1px solid #4a5568;
}

.kms-auth-btn.kms-secondary:hover {
  background: #3d4758;
  border-color: #5a6578;
}

.kms-auth-icon {
  font-size: 1.25rem;
}

.kms-auth-label {
  font-size: 1rem;
}

.kms-auth-hint {
  margin: 0.5rem 0 0 0;
  font-size: 0.8rem;
  color: #888;
  text-align: center;
}

.kms-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: #666;
  font-size: 0.875rem;
}

.kms-divider::before,
.kms-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #333;
}

.kms-divider span {
  padding: 0 1rem;
}

.kms-input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #ccc;
  font-weight: 500;
}

.kms-input {
  width: 100%;
  padding: 0.75rem;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.kms-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.kms-input::placeholder {
  color: #666;
}

.kms-modal-error {
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #f87171;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.kms-modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  color: #a5b4fc;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.kms-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(165, 180, 252, 0.3);
  border-top-color: #a5b4fc;
  border-radius: 50%;
  animation: kms-spin 0.8s linear infinite;
}

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

/* Helper classes to avoid inline styles (CSP compliance) */
.hidden {
  display: none !important;
}

.kms-char-count {
  margin: -0.5rem 0 0.5rem 0;
  font-size: 0.75rem;
  color: #666;
}

.kms-match-feedback {
  margin: -0.5rem 0 0.5rem 0;
  font-size: 0.75rem;
}

/* Color state classes for dynamic feedback */
.success {
  color: #48d391 !important;
}

.error {
  color: #ef4444 !important;
}

/* Multi-enrollment unlock instructions (dynamically created) */
.multi-enrollment-instructions {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
}

.multi-enrollment-title {
  margin: 0 0 0.5rem 0;
  color: #a5b4fc;
  font-size: 0.875rem;
  font-weight: 600;
}

.multi-enrollment-description {
  margin: 0;
  color: #888;
  font-size: 0.8rem;
}

.kms-setup-success {
  padding: 1rem;
  background: rgba(72, 187, 120, 0.1);
  border: 1px solid rgba(72, 187, 120, 0.3);
  border-radius: 6px;
  color: #68d391;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.kms-success-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kms-success-icon {
  font-size: 1.5rem;
}

.kms-success-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.kms-success-message {
  opacity: 0.9;
}
