*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #111213;
  color: #f2f2f2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.sub {
  margin: 0 0 28px;
  color: #b0b4b8;
  line-height: 1.4;
}

.card, .dropzone, .current-frame {
  background: #1c1e21;
  border: 1px solid #2c2f33;
  border-radius: 16px;
}

.card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  font-size: 14px;
  color: #c5c8cc;
}

input[type="password"], input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #3a3f45;
  background: #121314;
  color: #fff;
  font-size: 16px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: #e8e8e8;
  color: #111;
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.link {
  background: none;
  color: #9aa0a6;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
}

.dropzone {
  position: relative;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.dragover {
  border-color: #f2f2f2;
  background: #26292d;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.drop-copy strong {
  font-size: 18px;
}

.drop-copy span {
  color: #b0b4b8;
}

.hint {
  font-size: 13px;
  color: #8a8f94 !important;
  margin-top: 8px;
}

.preview-block { margin-top: 28px; }

.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.preview-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.current-frame {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.current-frame img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

.empty {
  color: #8a8f94;
  margin: 24px;
}

.msg {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.4;
}

.msg.success {
  background: #14301c;
  color: #b6f0c4;
}

.msg.error {
  background: #3a1515;
  color: #ffc1c1;
}

.msg.info {
  background: #1b2430;
  color: #c9d4e3;
}

[hidden] { display: none !important; }
