:root {
  --bg-1: #070c1a;
  --bg-2: #0b1224;
  --card: #121a2d;
  --card-border: rgba(255, 255, 255, 0.06);
  --text: #e9eefc;
  --muted: #8c94ad;
  --accent: #2be0c3;
  --accent-strong: #1dd3b4;
  --error: #ff7b7b;
  --outline: rgba(43, 224, 195, 0.25);
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(43, 224, 195, 0.1), transparent 25%),
              radial-gradient(circle at 80% 0%, rgba(93, 120, 255, 0.08), transparent 25%),
              linear-gradient(135deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 48px;
}

.wrapper {
  width: 100%;
  max-width: 560px;
}

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.02), transparent),
              var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.05), transparent 35%),
              radial-gradient(circle at 75% 0%, rgba(43, 224, 195, 0.08), transparent 35%);
  pointer-events: none;
}

.headings {
  position: relative;
  z-index: 1;
}

h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 0 10px;
  color: var(--muted);
}

.security-note {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 14px;
  opacity: 0.9;
}

.field {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 600;
}

.file-input {
  display: none;
}

.file-label {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--card-border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.file-label:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.file-action {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #031017;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.file-name {
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.password-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.password-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--outline);
}

.text-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 12px 10px;
  font-size: 15px;
  outline: none;
}

.ghost-button {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.hint.weak {
  color: #ff9f6b;
}

.hint.strong {
  color: #9fffb9;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.btn {
  position: relative;
  border: none;
  border-radius: 999px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  color: var(--text);
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #021114;
  box-shadow: 0 12px 30px rgba(43, 224, 195, 0.25);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
}

.btn:hover {
  transform: translateY(-1px) scale(1.01);
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.secondary.is-loading::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.status {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  min-height: 18px;
}

.status.error {
  color: var(--error);
}

.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

@media (max-width: 520px) {
  .card {
    padding: 22px 18px;
  }

  h1 {
    font-size: 24px;
  }
}
