:root {
  --navy: #0B1D33;
  --blue: #123A5A;
  --blue-soft: #1F5A7A;
  --gray: #6B7C8A;
  --line: #D7DDE2;
  --bg: #F5F7F9;
  --white: #FFFFFF;
  --danger-bg: #FFF1F2;
  --danger: #B42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--navy);
  background:
    radial-gradient(circle at top, #FFFFFF 0, var(--bg) 58%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.hero {
  width: min(100%, 760px);
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.65rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.subtitle {
  width: min(100%, 630px);
  margin: 20px auto 34px;
  color: var(--gray);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.65;
}

.converter-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 70px rgba(11, 29, 51, 0.10);
}

.drop-zone {
  min-height: 250px;
  padding: 34px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #B9C4CD;
  border-radius: 18px;
  background: #FAFBFC;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--blue-soft);
  background: #F4F9FC;
  transform: translateY(-1px);
}

.file-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #EAF1F5;
}

.file-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-title {
  font-size: 1.08rem;
  font-weight: 760;
}

.drop-help {
  margin-top: 8px;
  color: var(--gray);
  font-size: 0.92rem;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.selection-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #FBFCFD;
  text-align: left;
}

.selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.selection-eyebrow {
  margin: 0 0 3px;
  color: var(--gray);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-count {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 760;
}

.clear-button {
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--blue);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}

.clear-button:hover {
  background: #EEF3F6;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #E2E7EB;
  border-radius: 11px;
  background: var(--white);
}

.file-info {
  min-width: 0;
}

.file-name {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  display: block;
  margin-top: 2px;
  color: var(--gray);
  font-size: 0.76rem;
}

.remove-button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--gray);
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
}

.remove-button:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.error {
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid #FFD0D5;
  border-radius: 12px;
  color: var(--danger);
  background: var(--danger-bg);
  text-align: left;
  font-size: 0.92rem;
}

.submit-button {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 13px;
  color: var(--white);
  background: var(--navy);
  font-weight: 760;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.submit-button:hover:not(:disabled) {
  background: var(--blue);
}

.submit-button:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.submit-button.loading {
  cursor: wait;
  opacity: 0.78;
}

.spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.submit-button.loading .spinner {
  display: block;
}

.privacy-note {
  margin: 14px 6px 0;
  color: var(--gray);
  font-size: 0.8rem;
}

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

@media (max-width: 560px) {
  .page {
    padding: 20px 12px;
  }

  .converter-card {
    padding: 12px;
    border-radius: 18px;
  }

  .drop-zone {
    min-height: 215px;
    padding: 28px 18px;
  }

  .selection-header {
    align-items: flex-start;
  }

  .file-item {
    padding: 9px 10px;
  }
}
