/* Header */
.page-header {
  position: relative;
  text-align: center;
  margin-bottom: 2rem;
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
}
.page-header p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.9rem;
}
.page-header .btn-theme {
  position: absolute;
  top: 0;
  right: 0;
}

/* Card */
.card {
  padding: 1.5rem;
}
.card-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 1.1rem;
}

/* Fields */
.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.3rem 0 0;
}

/* Key input */
.key-input {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  text-align: center;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  max-width: 260px;
  padding: 0.5rem 0.75rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.key-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* URL input */
.url-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.url-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Drop zone */
.zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
  user-select: none;
}
.zone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.zone:hover,
.zone.dragging {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.04);
}
.zone.has-file {
  border-color: var(--success-border);
  background: var(--success-bg);
}
.zone-icon {
  font-size: 2rem;
  opacity: 0.4;
  margin-bottom: 0.4rem;
}
.zone-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}
.zone-label strong {
  color: var(--accent);
}
.zone-formats {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin: 0.3rem 0 0;
}
.zone-file-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}
.zone-file-name {
  font-weight: 500;
  color: var(--success-text);
  word-break: break-all;
}
.zone-file-size {
  font-size: 0.8rem;
  color: var(--success-text);
  opacity: 0.8;
}

/* Options */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
@media (max-width: 480px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.option-item:has(input:checked) {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.04);
}
.option-item input[type='checkbox'] {
  margin-top: 0.2rem;
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  cursor: pointer;
}
.option-label-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.option-label {
  font-size: 0.875rem;
  font-weight: 500;
}
.option-tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--border);
  border-radius: 3px;
  padding: 0.1em 0.45em;
  line-height: 1.6;
  white-space: nowrap;
}
.option-desc {
  display: block;
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  line-height: 1.4;
}

/* Submit button */
.btn-primary {
  display: block;
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.12s,
    transform 0.08s;
  line-height: 1;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Status message */
.status-msg {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-top: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.status-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  cursor: pointer;
}
.status-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  cursor: pointer;
}
.status-info {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Progress bar */
.progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.7rem;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.2s ease;
}

/* Instructions */
.instructions {
  margin-top: 1rem;
}
.instructions p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 0.6rem;
}
.instructions p:last-child {
  margin-bottom: 0;
}

/* Footer */
.page-footer {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  line-height: 1.8;
}
.page-footer a {
  color: var(--text-muted);
}
.page-footer a:hover {
  color: var(--text);
}
