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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #2d3748;
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  min-height: 100vh;
  padding: 24px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a202c;
}

.subtitle {
  color: #718096;
  margin-bottom: 32px;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #2d3748;
}

.avatar-section {
  margin-bottom: 40px;
}

.avatar-preview {
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #e8e4f0;
  background: #fafafa;
  position: relative;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.avatar-icon {
  font-size: 48px;
  opacity: 0.5;
}

.avatar-text {
  font-size: 12px;
  color: #718096;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.file-input {
  display: none;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-primary {
  background: #8b7fc7;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #7a6fb6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 127, 199, 0.3);
}

.btn-success {
  background: #48bb78;
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #38a169;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.btn-danger {
  background: #f56565;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #e53e3e;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(245, 101, 101, 0.3);
}

.file-info {
  text-align: center;
  font-size: 13px;
  color: #718096;
  min-height: 20px;
}

.gallery-section {
  border-top: 1px solid #e8e4f0;
  padding-top: 32px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e8e4f0;
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-item:hover {
  border-color: #8b7fc7;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(139, 127, 199, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item.active {
  border-color: #8b7fc7;
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(139, 127, 199, 0.2);
}

.gallery-item-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(245, 101, 101, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.gallery-item:hover .gallery-item-delete {
  display: flex;
}

.gallery-item-delete:hover {
  background: #e53e3e;
  transform: scale(1.1);
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px;
  color: #718096;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px;
  color: #718096;
  font-size: 13px;
}

.message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}

.message.show {
  display: block;
}

.message.success {
  background: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.message.error {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

@media (max-width: 600px) {
  .card {
    padding: 24px;
  }

  .upload-controls {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
  }
}