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

/* --- Password gate --- */
#password-gate {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

#password-gate[hidden] { display: none; }

.gate-card {
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 12px;
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.gate-logo {
  width: 48px;
  height: 48px;
  background: #393E46;
  color: #F2E7D5;
  border-radius: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  letter-spacing: -0.02em;
}

.gate-card h1 { margin-bottom: 0.25rem; color: #111; }
.gate-card .subtitle { margin-bottom: 1.75rem; color: #6b6b6b; }

#pw-input {
  width: 100%;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  color: #111;
  padding: 0.65rem 0.875rem;
  font-size: 0.9rem;
  text-align: center;
  letter-spacing: 0.1em;
  transition: border-color 0.15s;
}

#pw-input:focus {
  outline: none;
  border-color: #393E46;
}

#pw-form button[type="submit"] {
  margin-top: 1rem;
  width: 100%;
  padding: 0.8rem;
  background: #393E46;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

#pw-form button[type="submit"]:hover:not(:disabled) { opacity: 0.85; }

#pw-form button[type="submit"]:disabled {
  background: #e5e5e5;
  color: #aaa;
  cursor: not-allowed;
}

.pw-error {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #c62828;
}

/* --- App container --- */
#app {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem 4rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #393E46;
  color: #111;
  min-height: 100vh;
}

/* --- Header --- */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}


h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
}

header h1 {
  color: #eeeeee;
}

header .subtitle {
  color: rgba(238, 238, 238, 0.55);
}

.subtitle {
  margin-top: 0.3rem;
  color: #6b6b6b;
  font-size: 0.875rem;
}

/* --- Card --- */
.card {
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
}

/* --- Tabs — underline style --- */
.tabs {
  display: flex;
  border-bottom: 1.5px solid #e5e5e5;
  margin-bottom: 1.75rem;
}

.tab {
  flex: 1;
  padding: 0.6rem 0;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  color: #6b6b6b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover { color: #111; }

.tab.active {
  color: #393E46;
  border-bottom-color: #393E46;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- Drop zone --- */
.drop-zone {
  border: 1.5px dashed #d0d0d0;
  border-radius: 8px;
  padding: 2rem 1rem 1.5rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone.dragover,
.drop-zone.has-file {
  border-color: #393E46;
  background: #F2E7D5;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.75rem;
  color: #bbb;
  transition: color 0.15s;
}

.drop-zone:hover .drop-zone-icon,
.drop-zone.dragover .drop-zone-icon,
.drop-zone.has-file .drop-zone-icon {
  color: #393E46;
}

.drop-zone-icon svg { width: 100%; height: 100%; }

.drop-zone-text {
  font-size: 0.9rem;
  color: #6b6b6b;
}

.drop-zone-filename {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #393E46;
}

.drop-zone-hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #bbb;
  letter-spacing: 0.01em;
}

/* --- URL hint --- */
.field-hint {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: #aaa;
  line-height: 1.5;
}

/* --- Inputs --- */
input[type="url"],
input[type="email"] {
  width: 100%;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  color: #111;
  padding: 0.65rem 0.875rem;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

input[type="url"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: #393E46;
}

input::placeholder { color: #bbb; }

/* --- Options grid --- */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.field label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b6b6b;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

select {
  width: 100%;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  color: #111;
  padding: 0.65rem 2.5rem 0.65rem 0.875rem;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  transition: border-color 0.15s;
}

select:focus {
  outline: none;
  border-color: #393E46;
}

.field-email { grid-column: span 2; }

/* --- Tooltip icon --- */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e5e5e5;
  color: #6b6b6b;
  font-size: 0.65rem;
  font-weight: 700;
  font-style: normal;
  cursor: default;
  text-transform: none;
  letter-spacing: 0;
  position: relative;
  flex-shrink: 0;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #393E46;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  width: 220px;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.info-icon::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #393E46;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.info-icon:hover::after,
.info-icon:hover::before { opacity: 1; }

/* --- Submit button --- */
button[type="submit"] {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.8rem;
  background: #393E46;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity 0.15s;
}

button[type="submit"]:hover:not(:disabled) { opacity: 0.85; }

button[type="submit"]:disabled {
  background: #e5e5e5;
  color: #aaa;
  cursor: not-allowed;
}

.submit-hint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: #bbb;
  text-align: center;
}

/* --- Status --- */
#status-section {
  margin-top: 1.5rem;
  display: none;
}

.status-box {
  border-left: 3px solid #e5e5e5;
  padding: 0.875rem 1rem;
  background: #fafafa;
  border-radius: 0 6px 6px 0;
}

.status-box.queued     { border-left-color: #bbb; }
.status-box.processing { border-left-color: #393E46; background: #F2E7D5; }
.status-box.done       { border-left-color: #2a7d4f; }
.status-box.error      { border-left-color: #c62828; }

.status-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b6b6b;
  margin-bottom: 0.3rem;
}

.status-text {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.status-text.queued     { color: #6b6b6b; }
.status-text.processing { color: #393E46; }
.status-text.done       { color: #2a7d4f; }
.status-text.error      { color: #c62828; }

/* --- Progress bar --- */
.progress-bar {
  height: 3px;
  background: #e5e5e5;
  border-radius: 2px;
  margin-top: 0.75rem;
  overflow: hidden;
  display: none;
}

.progress-fill {
  height: 100%;
  background: #393E46;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* --- Download button --- */
.download-btn {
  display: none;
  margin-top: 0.875rem;
  width: 100%;
  padding: 0.75rem;
  background: #F2E7D5;
  color: #393E46;
  border: 1.5px solid #393E46;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}

.download-btn:hover {
  background: #393E46;
  color: #fff;
}

/* --- Footer --- */
.app-footer {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 560px;
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-top: 1px solid rgba(238, 238, 238, 0.12);
}

.footer-link {
  background: none;
  border: none;
  font-size: 0.82rem;
  color: rgba(238, 238, 238, 0.4);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.15s;
  font-family: inherit;
}

.footer-link:hover { color: #eeeeee; }

.footer-sep {
  color: rgba(238, 238, 238, 0.18);
  font-size: 0.82rem;
  user-select: none;
}

.feedback-form-wrap {
  margin-top: 1rem;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: left;
}

.feedback-form-wrap textarea {
  width: 100%;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: #111;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.15s;
}

.feedback-form-wrap textarea:focus {
  outline: none;
  border-color: #393E46;
}

.feedback-form-wrap textarea::placeholder { color: #bbb; }

.feedback-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.feedback-actions button {
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  border: none;
}

#feedback-submit {
  background: #393E46;
  color: #fff;
}

#feedback-submit:hover:not(:disabled) { opacity: 0.85; }
#feedback-submit:disabled { background: #e5e5e5; color: #aaa; cursor: not-allowed; }

.feedback-cancel {
  background: #f5f5f5;
  color: #6b6b6b;
}

.feedback-cancel:hover { background: #ebebeb; }

.feedback-status {
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

.feedback-status.success { color: #2a7d4f; }
.feedback-status.error   { color: #c62828; }

/* --- Responsive --- */
@media (max-width: 480px) {
  #app { padding: 2rem 0.75rem 3rem; }
  .card { padding: 1.5rem; }
  .gate-card { padding: 1.5rem; }
  .options { grid-template-columns: 1fr; }
  .field-email { grid-column: span 1; }
  h1 { font-size: 1.5rem; }
  .info-icon::after { width: 180px; }
}
