*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #101827 0, #020617 45%, #020617 100%);
  color: #e5e7eb;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.page {
  width: 100%;
  max-width: 960px;
}

.card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 24px;
  padding: 28px 24px 24px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(18px);
}

.card-header {
  margin-bottom: 20px;
}

.title {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

.inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  gap: 16px 20px;
  align-items: end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 13px;
  color: #e5e7eb;
  font-weight: 500;
}

.field-hint {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.file-input,
.select-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

.file-input::file-selector-button {
  margin-right: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 12px;
}

.file-input:hover::file-selector-button {
  border-color: #38bdf8;
}

.select-input:focus,
.file-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.primary-btn {
  grid-column: 2 / 3;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e, #22c55e, #0ea5e9);
  color: #020617;
  box-shadow:
    0 14px 30px rgba(34, 197, 94, 0.4),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  transition:
    transform 0.08s ease-out,
    box-shadow 0.08s ease-out,
    filter 0.08s ease-out,
    opacity 0.08s ease-out,
    background 0.08s ease-out;
  justify-self: end;
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.primary-btn:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow:
    0 18px 40px rgba(34, 197, 94, 0.5),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.primary-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow:
    0 10px 22px rgba(34, 197, 94, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.status-text {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  color: #9ca3af;
}

.status-text--error {
  color: #fca5a5;
}

.status-text--success {
  color: #4ade80;
}

.status-text--loading {
  color: #fbbf24;
}

.result {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.result-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;
}

.secondary-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.08s ease-out,
    border-color 0.08s ease-out,
    opacity 0.08s ease-out;
}

.secondary-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.secondary-btn:not(:disabled):hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.9);
}

.result-body {
  border-radius: 18px;
  border: 1px dashed rgba(55, 65, 81, 0.9);
  background: radial-gradient(circle at top left, #0f172a 0, #020617 50%);
  min-height: 260px;
  padding: 12px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.result-placeholder {
  border-radius: 14px;
  border: 1px dashed rgba(75, 85, 99, 0.9);
  color: #6b7280;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.result-image {
  max-width: 100%;
  max-height: 420px;
  border-radius: 14px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
}

@media (max-width: 768px) {
  body {
    padding: 16px;
    align-items: stretch;
  }

  .card {
    padding: 20px 16px 18px;
    border-radius: 20px;
  }

  .inputs {
    grid-template-columns: 1fr;
  }

  .primary-btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }
}

