* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: #1a1a1a;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  height: 32px;
  width: auto;
}

header .logo {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Main */
main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
}

.card {
  background: white;
  width: 100%;
  max-width: 520px;
  padding: 48px;
  overflow: hidden;
  position: relative;
}

/* Overall progress bar */
.overall-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #ebebeb;
}

.overall-progress-bar {
  height: 4px;
  background: #1a1a1a;
  width: 0%;
  transition: width 0.3s ease;
}

/* Title */
h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 36px;
}

/* Divider */
.divider {
  height: 1px;
  background: #e8e8e8;
  margin-bottom: 32px;
}

/* Form */
.form-group {
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.required {
  color: #1a1a1a;
}

.optional {
  font-weight: 400;
  color: #aaa;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
}

input[type="text"] {
  width: 100%;
  padding: 11px 0;
  border: none;
  border-bottom: 1.5px solid #d0d0d0;
  background: transparent;
  font-size: 0.95rem;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s;
  border-radius: 0;
}

input[type="text"]::placeholder {
  color: #bbb;
}

input[type="text"]:focus {
  border-bottom-color: #1a1a1a;
}

input[type="text"].error {
  border-bottom-color: #c0392b;
}

.field-error {
  display: block;
  font-size: 0.75rem;
  color: #c0392b;
  margin-top: 6px;
  letter-spacing: 0.01em;
}

.dropzone.error {
  border-color: #c0392b;
  background: #fff8f8;
}

/* Dropzone */
.dropzone {
  border: 1.5px dashed #d0d0d0;
  border-radius: 4px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  margin: 28px 0;
  transition: border-color 0.2s, background 0.2s;
  background: #fafafa;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #1a1a1a;
  background: #f3f3f3;
}

.dropzone.dragover {
  background: #eef2ff;
  border-color: #1a1a1a;
  border-style: solid;
}

.dropzone-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  color: #aaa;
  display: block;
}

.dropzone p {
  color: #888;
  font-size: 0.875rem;
  line-height: 1.7;
}

.dropzone p strong {
  color: #1a1a1a;
  font-weight: 600;
}

.dropzone span {
  color: #1a1a1a;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dropzone-hint {
  font-size: 0.75rem !important;
  color: #bbb !important;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* File list */
.file-list {
  margin-bottom: 24px;
  border-top: 1px solid #e8e8e8;
}

.file-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e8e8e8;
  font-size: 0.875rem;
}

/* Folder groups */
.folder-group {
  border-bottom: 1px solid #e8e8e8;
}

.folder-header {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0 12px;
  align-items: center;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
}

.folder-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.folder-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-meta {
  font-size: 0.75rem;
  color: #aaa;
}

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

.folder-chevron {
  color: #bbb;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.folder-chevron.collapsed {
  transform: rotate(-90deg);
}

.folder-items {
  margin-left: 24px;
  padding-left: 12px;
  border-left: 2px solid #ebebeb;
  margin-bottom: 4px;
}

.file-item-nested {
  border-bottom: 1px solid #f2f2f2;
}

.file-item-nested:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.file-thumb {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  background: #f0f0f0;
}

.file-thumb-type {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-info {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.file-name {
  color: #1a1a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

.file-size {
  color: #aaa;
  font-size: 0.75rem;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 3;
  grid-row: 1;
}

.file-status {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
}

.progress-bar-wrap {
  grid-column: 2 / -1;
  grid-row: 2;
  background: #ebebeb;
  height: 6px;
  width: 100%;
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
  position: relative;
}


.progress-bar {
  height: 6px;
  background: #1a1a1a;
  width: 0%;
  border-radius: 99px;
  transition: width 0.3s ease, background 0.4s ease;
}

.progress-bar.uploading {
  min-width: 6%;
  background: linear-gradient(90deg, #333 0%, #666 50%, #333 100%);
  background-size: 200% 100%;
  animation: bar-shine 1.2s linear infinite;
}

@keyframes bar-shine {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.progress-bar.done {
  background: #2d6a4f;
  min-width: 0%;
  animation: none;
}


.file-pct {
  font-size: 0.75rem;
  color: #aaa;
  white-space: nowrap;
  min-width: 32px;
  text-align: right;
}

.remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #ccc;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  flex-shrink: 0;
}

.remove-btn:hover {
  color: #c0392b;
}

.remove-btn svg {
  width: 14px;
  height: 14px;
}

/* Terms checkbox */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  margin-top: 4px;
}

.terms-row input[type="checkbox"] {
  margin-top: 3px;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: #1a1a1a;
  cursor: pointer;
}

.terms-label {
  font-size: 0.8rem;
  color: #555;
  line-height: 1.6;
  cursor: default;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: #1a1a1a;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-btn:hover {
  color: #444;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: white;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.modal-close:hover {
  color: #1a1a1a;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.85rem;
  color: #444;
  line-height: 1.7;
}

.modal-date {
  color: #aaa;
  font-size: 0.78rem;
  margin-bottom: 16px;
}

.modal-body h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 20px;
  margin-bottom: 6px;
}

.modal-body h3:first-of-type {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 8px;
}

.modal-body ul {
  padding-left: 18px;
  margin-bottom: 8px;
}

.modal-body ul li {
  margin-bottom: 4px;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.btn-sm {
  width: auto;
  padding: 10px 24px;
  font-size: 0.75rem;
}

/* Button */
.btn {
  width: 100%;
  padding: 15px;
  background: #1a1a1a;
  color: white;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.1s;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-spinner {
  animation: spin 0.8s linear infinite;
}

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

.btn:hover:not(:disabled) {
  background: #2d2d2d;
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Status */
.status {
  margin-top: 16px;
  padding: 12px 0;
  font-size: 0.875rem;
  border-top: 1.5px solid transparent;
}

.status.success {
  color: #2d6a4f;
  border-top-color: #2d6a4f;
}

.status.error {
  color: #c0392b;
  border-top-color: #c0392b;
}

.hidden {
  display: none;
}

/* Success panel */
.success-panel {
  text-align: center;
  padding: 16px 0 8px;
}

.success-icon {
  width: 68px;
  height: 68px;
  background: #2d6a4f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.success-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.success-message {
  font-size: 0.875rem;
  color: #888;
  line-height: 1.7;
  margin-bottom: 32px;
}

.success-message strong {
  color: #1a1a1a;
}

/* Footer */
footer {
  padding: 24px 40px;
  text-align: center;
  font-size: 0.75rem;
  color: #bbb;
  letter-spacing: 0.04em;
  line-height: 1.8;
}

footer a {
  color: #999;
  text-decoration: none;
}

footer a:hover {
  color: #555;
  text-decoration: underline;
}
