:root {
  --background: #f4f6fa;
  --card: #ffffff;
  --text: #182033;
  --muted: #697386;
  --line: #dfe4ec;
  --primary: #315be8;
  --primary-hover: #264bc8;
  --soft-primary: #eef2ff;
  --danger: #d14343;
  --danger-soft: #fff1f1;
  --success: #16845b;
  --success-soft: #edf9f4;
  --shadow: 0 18px 50px rgba(30, 45, 80, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #e6edff, transparent 34%),
    var(--background);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  width: 100%;
  min-height: 100vh;
  padding: 56px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.converter-card {
  width: min(760px, 100%);
  padding: 44px;
  border: 1px solid rgba(223, 228, 236, 0.85);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.title-area {
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.description {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.drop-zone {
  padding: 36px 24px;
  text-align: center;
  border: 2px dashed #bdc7dc;
  border-radius: 18px;
  background: #fafbfe;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.dragging {
  border-color: var(--primary);
  background: var(--soft-primary);
  transform: translateY(-1px);
  outline: none;
}

.file-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: var(--primary);
  border-radius: 18px;
  background: #dfe7ff;
  font-weight: 900;
}

.drop-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.drop-description {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.secondary-button {
  padding: 11px 18px;
  color: var(--primary);
  border: 1px solid #cbd5f5;
  border-radius: 11px;
  background: #ffffff;
  font-weight: 800;
}

.selected-files-section {
  margin-top: 24px;
}

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

.selected-files-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.selected-files-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.remove-all-button {
  flex: 0 0 auto;
  padding: 9px 12px;
  color: var(--danger);
  border: 1px solid #f0caca;
  border-radius: 10px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.remove-all-button:hover {
  background: var(--danger-soft);
}

.selected-files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-item {
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfe;
}

.file-item-info {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}

.file-item-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--primary);
  border-radius: 11px;
  background: var(--soft-primary);
  font-size: 12px;
  font-weight: 900;
}

.file-item-text {
  min-width: 0;
}

.file-item-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
}

.file-item-size {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.file-remove-button {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: var(--danger);
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-weight: 800;
}

.file-remove-button:hover {
  background: var(--danger-soft);
}

.primary-button {
  width: 100%;
  height: 54px;
  margin-top: 24px;
  color: #ffffff;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  font-size: 17px;
  font-weight: 900;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.status-box {
  min-height: 54px;
  margin-top: 18px;
  padding: 15px 17px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 13px;
  background: #f4f6fa;
}

.status-box.success {
  color: var(--success);
  background: var(--success-soft);
}

.status-box.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-box p {
  margin: 0;
  line-height: 1.5;
  font-weight: 700;
}

.spinner {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  border: 3px solid #cbd5e8;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.hidden {
  display: none !important;
}

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

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

  .converter-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .drop-zone {
    padding: 28px 16px;
  }

  .selected-files-header {
    align-items: flex-start;
  }

  .file-item {
    align-items: flex-start;
  }

  .file-item-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}