/* =============================================================================
 * Smart Cyber Cafe — Centralized Password Modal Component Stylesheet
 * Complete redesign: Glassmorphism backdrop, squircle badge, safe file card,
 * password visibility toggle, accessible focus indicators, and responsive layout.
 * ========================================================================== */

/* --- Keyframe Animations --- */
@keyframes sccModalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sccModalPopIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes sccIconPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scc-password-modal,
  .scc-password-card,
  .scc-password-error.shake {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Modal Overlay --- */
.scc-password-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: sccModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scc-password-modal.hidden {
  display: none !important;
}

/* --- Modal Dialog Card --- */
.scc-password-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow:
    0 25px 60px -15px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(226, 232, 240, 0.85);
  padding: 28px 30px;
  box-sizing: border-box;
  animation: sccModalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  color: #1e293b;
  font-family: inherit;
}

/* --- Close Button (X) --- */
.scc-password-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.scc-password-close-btn:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #ef4444;
  transform: rotate(90deg);
}

.scc-password-close-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* --- Header Section --- */
.scc-password-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-right: 32px; /* clearance for close button */
}

.scc-password-icon-badge {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #bfdbfe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  animation: sccIconPulse 3s infinite ease-in-out;
}

.scc-password-header-text {
  flex: 1;
  min-width: 0;
}

.scc-password-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.scc-password-subtitle {
  margin: 3px 0 0 0;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
}

/* --- Dedicated File Information Card --- */
.scc-password-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.scc-password-file-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.25);
}

.scc-password-file-meta {
  flex: 1;
  min-width: 0;
}

.scc-password-file-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}

.scc-password-file-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-all;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scc-password-file-badge {
  padding: 4px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* --- Password Format Hint Card --- */
.scc-password-hint {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.5;
}

.scc-password-hint-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 4px;
  font-size: 13px;
}

.scc-password-hint-header i {
  color: #2563eb;
  font-size: 14px;
}

.scc-password-hint-body {
  color: #1e3a8a;
}

.scc-password-hint-example {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed #bfdbfe;
  font-size: 12px;
  color: #3b82f6;
}

.scc-password-hint-example strong {
  color: #1d4ed8;
  letter-spacing: 0.03em;
  background: #dbeafe;
  padding: 1px 6px;
  border-radius: 4px;
}

/* --- Password Input Group --- */
.scc-password-input-group {
  margin-bottom: 12px;
}

.scc-password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.scc-password-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 15px;
  pointer-events: none;
  transition: color 0.2s ease;
}

.scc-password-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 46px 12px 42px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  transition: all 0.2s ease;
  outline: none;
  letter-spacing: 0.02em;
}

.scc-password-input.uppercase {
  text-transform: uppercase;
}

.scc-password-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.scc-password-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.scc-password-input:focus + .scc-password-input-icon {
  color: #2563eb;
}

/* --- Password Input Meta / Footer (Format Badge & Live Counter) --- */
.scc-password-input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 0 4px;
  font-size: 11.5px;
  min-height: 20px;
}

.scc-password-format-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #1d4ed8;
  font-weight: 600;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.scc-password-format-tag i {
  font-size: 10px;
  color: #2563eb;
}

.scc-password-counter {
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  margin-left: auto;
  font-size: 11.5px;
}

.scc-password-counter.limit-reached {
  color: #059669;
}

/* --- Password Toggle Eye Button --- */
.scc-password-toggle-btn {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.18s ease;
  padding: 0;
}

.scc-password-toggle-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.scc-password-toggle-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* --- Error Alert Banner (Complete Redesign: Top-Aligned, Safe-Wrap) --- */
.scc-password-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-left: 4px solid #ef4444;
  border-radius: 10px;
  color: #991b1b;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  margin-top: 10px;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.scc-password-error-icon {
  color: #dc2626;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.scc-password-error-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: #991b1b;
}

.scc-password-err-chip {
  display: inline-block;
  max-width: 100%;
  font-weight: 700;
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 1px 6px;
  border-radius: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.scc-password-error.hidden {
  display: none !important;
}

.scc-password-error.shake {
  animation: sccShake 0.4s ease-in-out;
}

/* --- Batch Option Checkbox --- */
.scc-password-batch-option {
  margin-top: 12px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.scc-password-checkbox {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.scc-password-batch-label {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
}

.scc-password-batch-subtext {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  font-weight: 400;
  margin-top: 2px;
}

/* --- Footer Actions --- */
.scc-password-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.scc-password-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  text-decoration: none;
}

.scc-password-btn-ghost {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #475569;
}

.scc-password-btn-ghost:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.scc-password-btn-secondary {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  color: #334155;
}

.scc-password-btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}

.scc-password-btn-primary {
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.scc-password-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #132549 0%, #1d4ed8 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.scc-password-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.scc-password-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* --- Responsive Adjustments --- */
@media (max-width: 480px) {
  .scc-password-card {
    padding: 22px 18px;
    border-radius: 20px;
    max-width: 95vw;
  }

  .scc-password-header {
    gap: 12px;
    margin-bottom: 16px;
  }

  .scc-password-icon-badge {
    width: 44px;
    height: 44px;
    font-size: 19px;
  }

  .scc-password-title {
    font-size: 17px;
  }

  .scc-password-footer {
    flex-direction: column-reverse;
  }

  .scc-password-btn {
    width: 100%;
    padding: 12px;
  }
}
