:root {
  --bg: #f7fafc;
  --card: #ffffff;
  --muted: #6b7280;
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --glass: rgba(15, 23, 42, 0.03);
  --radius: 14px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: radial-gradient(1000px 600px at 10% 10%, rgba(124, 92, 255, 0.06), transparent),
    linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  color: #0f1724;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.app {
  width: 100%;
  max-width: 920px;
}

.app-header {
  text-align: left;
  margin-bottom: 18px;
}

.app-header h1 {
  margin: 0 0 6px 0;
  font-size: 28px;
  letter-spacing: -0.4px;
}

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

.card {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.02), rgba(2, 6, 23, 0.01));
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 6px 30px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(15, 23, 42, 0.02);
  display: grid;
  gap: 14px;
}

.field {
  display: block
}

.label-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  display: block
}

input[type="password"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--glass);
  color: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  resize: none;
}

textarea::placeholder,
input::placeholder {
  color: rgba(15, 23, 42, 0.35)
}

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

.actions {
  display: flex;
  gap: 10px;
  align-items: center
}

.btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.btn.primary {
  background: linear-gradient(90deg, var(--accent), #6f44ff);
  color: white;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.12);
}

.btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--muted)
}

.output {
  margin-top: 6px;
  display: grid;
  gap: 8px
}

.output textarea {
  padding-right: 14px;
}

.output-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted)
}

.icon-btn svg {
  opacity: 0.95
}

.toast {
  margin-left: 6px;
  font-size: 13px;
  color: var(--accent-2);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0)
}

.footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px
}

.alert {
  position: fixed;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.02), rgba(2, 6, 23, 0.01));
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
  min-width: 260px;
  max-width: 90%;
  z-index: 1200;
  transition: transform .18s ease, opacity .18s ease;
}

.alert[hidden] {
  opacity: 0;
  transform: translate(-50%, -6px);
  pointer-events: none
}

.alert-content {
  display: flex;
  gap: 10px;
  align-items: center
}

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.03);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700
}

.alert-icon svg {
  width: 20px;
  height: 20px;
  display: block
}

.alert-message {
  flex: 1;
  color: inherit
}

.alert-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer
}

@media (min-width:720px) {
  .card {
    padding: 24px
  }

  .app-header h1 {
    font-size: 32px
  }
}

@media (min-width:1000px) {
  .card {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    align-items: start
  }

  .field {
    width: 100%
  }

  .output {
    margin-top: 0
  }
}

@media (max-width:420px) {
  .app {
    padding: 18px
  }

  .card {
    padding: 16px
  }

  .btn {
    padding: 10px
  }
}
