:root {
  --bg-color: #F7FAFF;
  --card-bg: #FFFFFF;
  --primary-blue: #168FF5;
  --bright-blue: #0B9DFF;
  --success-green: #16C784;
  --error-red: #EF4444;
  --warning-amber: #F59E0B;
  --text-primary: #10203A;
  --text-secondary: #64748B;
  --border-color: #DCE7F5;
  --accent-light-bg: #EEF5FF;
  --success-light-bg: #E6F9F0;
  --error-light-bg: #FEF2F2;
  --shadow-subtle: 0 4px 20px rgba(16, 32, 58, 0.05);
  --shadow-card: 0 8px 30px rgba(22, 143, 245, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 16px 12px;
}

.app-layout {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
}

.brand-logo {
  background: linear-gradient(135deg, var(--primary-blue), var(--bright-blue));
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}

.logo-icon {
  font-size: 22px;
  color: #ffffff;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.8px;
  line-height: 1.1;
}

.brand-title .highlight {
  color: var(--primary-blue);
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 2px;
}

/* Connection Status Card */
.status-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow-subtle);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

.status-dot.yellow { background-color: var(--warning-amber); }
.status-dot.blue { background-color: var(--bright-blue); }
.status-dot.green { background-color: var(--success-green); box-shadow: 0 0 10px rgba(22, 199, 132, 0.4); }
.status-dot.red { background-color: var(--error-red); }

.status-text-group {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.status-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 1px;
}

/* Main Form Card */
.main-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Input Group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.optional-tag {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 10.5px;
}

.text-input {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(22, 143, 245, 0.12);
}

.field-hint {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* File Dropzone Card */
.upload-dropzone {
  position: relative;
  background: var(--accent-light-bg);
  border: 2px dashed #B8D5FA;
  border-radius: 14px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.upload-dropzone:hover, .upload-dropzone:focus-within {
  background: #E4EFFE;
  border-color: var(--primary-blue);
}

.file-input {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.upload-badge {
  background: #FFFFFF;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(22, 143, 245, 0.15);
  margin-bottom: 10px;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.dropzone-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 3px;
}

.supported-formats {
  font-size: 10.5px;
  color: #7B8C9D;
  font-weight: 500;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 10px;
  border-radius: 12px;
}

/* Selected Files Section */
.file-list-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.total-size-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary-blue);
  background: var(--accent-light-bg);
  padding: 3px 8px;
  border-radius: 6px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.file-list::-webkit-scrollbar {
  width: 5px;
}
.file-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}

.file-card-item {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.15s, border-color 0.15s;
}

.file-card-item:hover {
  border-color: #B8D5FA;
}

.file-preview-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-light-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-icon-svg {
  width: 22px;
  height: 22px;
}

.file-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.file-name-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta-text {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.remove-file-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.remove-file-btn:hover {
  background: var(--error-light-bg);
  color: var(--error-red);
}

/* Pre-Transfer Summary */
.ready-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent-light-bg);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #D2E4FF;
}

.summary-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary-blue);
}

.summary-details {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Send Button */
.send-button {
  background: linear-gradient(135deg, var(--primary-blue), var(--bright-blue));
  color: #ffffff;
  border: none;
  border-radius: 16px;
  min-height: 60px;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(22, 143, 245, 0.3);
  transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
  width: 100%;
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(22, 143, 245, 0.4);
}

.send-button:active:not(:disabled) {
  transform: translateY(1px);
}

.send-button:disabled {
  background: #C5D8F2;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.8;
}

.button-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.button-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.6px;
}

.button-subtitle {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0.9;
}

/* Progress Card */
.progress-card {
  background: var(--accent-light-bg);
  border: 1px solid #D2E4FF;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-tracker {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
}

.step { color: var(--text-secondary); }
.step.done { color: var(--success-green); }
.step.active { color: var(--primary-blue); }

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-file-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.progress-percent {
  font-size: 14px;
  font-weight: 900;
  color: var(--primary-blue);
}

.progress-bar-track {
  background: #DCE7F5;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary-blue), var(--bright-blue));
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Success Card */
.success-card {
  text-align: center;
  align-items: center;
  padding: 32px 20px;
}

.success-icon-badge {
  background: var(--success-light-bg);
  color: var(--success-green);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(22, 199, 132, 0.2);
}

.success-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
}

.success-subtitle {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--success-green);
  margin-top: 4px;
}

.success-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 8px;
  margin-bottom: 20px;
}

/* Error Card */
.error-card {
  text-align: center;
  align-items: center;
  padding: 28px 20px;
}

.error-icon-badge {
  background: var(--error-light-bg);
  color: var(--error-red);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 12px;
}

.error-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-primary);
}

.error-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 18px;
}

/* Action Buttons */
.action-button {
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s;
}

.action-button.primary {
  background: var(--primary-blue);
  color: #ffffff;
}

.action-button.secondary {
  background: var(--accent-light-bg);
  color: var(--primary-blue);
  border: 1px solid #D2E4FF;
}

/* Security Footer */
.security-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.security-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-subtle);
}

.sec-icon {
  font-size: 18px;
}

.sec-text h3 {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}

.sec-text p {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.hidden {
  display: none !important;
}
