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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f2f2f7;
  color: #1d1d1f;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 2rem;
}

/* --- Top nav --- */

.top-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 0 -1rem;
  width: calc(100% + 2rem);
}

.top-nav-left {
  display: flex;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.nav-logo:hover {
  opacity: 1;
}

.top-nav-center {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: #1d1d1f;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  transition: background 0.12s;
}

.nav-link:hover {
  background: #f0f0f5;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-brand {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: 0.04em;
}

.nav-avatar {
  width: 28px;
  height: 28px;
  background: #1d1d1f;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
}

.container {
  width: 100%;
  max-width: 380px;
  margin-top: 3rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Card wrapper with label --- */

.card-wrapper {
  position: relative;
  padding-top: 1rem;
}

.card-label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #e8e8ed;
  color: #1d1d1f;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1.1rem;
  border-radius: 18px;
  white-space: nowrap;
  z-index: 1;
  letter-spacing: -0.01em;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 2.25rem 1.5rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

/* --- Upload buttons --- */

.upload-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.upload-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem 0.85rem;
  background: #eef0fb;
  border: none;
  border-radius: 12px;
  color: #1d1d1f;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.upload-btn:hover {
  background: #e2e6f9;
}

.upload-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Form fields --- */

.form-field {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  font-size: 0.72rem;
  color: #8e8e93;
  margin-bottom: 0;
  padding-top: 0.9rem;
  font-weight: 400;
}

.form-field input[type="email"],
.form-field input[type="text"] {
  width: 100%;
  padding: 0.55rem 0;
  background: none;
  border: none;
  border-bottom: 1px solid #e5e5ea;
  color: #1d1d1f;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-field input::placeholder {
  color: #c7c7cc;
  font-weight: 400;
}

.form-field input:focus {
  border-bottom-color: #4f6ef7;
}

.field-with-icon {
  position: relative;
}

.field-with-icon input {
  padding-right: 2.25rem;
}

.field-icon {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
}

/* --- Bottom row --- */

.bottom-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.retention-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  background: none;
  border: 1.5px solid #d1d1d6;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #1d1d1f;
  cursor: default;
  line-height: 1;
}

.retention-pill .chevron {
  margin-left: 0.1rem;
}

.more-wrapper {
  position: relative;
}

.more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1.5px solid #d1d1d6;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.more-btn:hover {
  background: #f5f5f7;
}

.more-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  padding: 0.35rem 0;
  min-width: 190px;
  z-index: 10;
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 400;
  color: #1d1d1f;
  transition: background 0.1s;
}

.more-menu-item:hover {
  background: #f5f5f7;
}

.more-menu-item input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d1d6;
  border-radius: 50%;
  margin: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.more-menu-item input[type="radio"]:checked {
  border-color: #4f6ef7;
  background: #4f6ef7;
}

.more-menu-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

/* --- CTA button --- */

.cta-btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: -0.01em;
}

.cta-btn:hover {
  background: #3d5bd9;
}

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

/* --- Selected files --- */

.selected-files {
  margin-bottom: 0.25rem;
  padding: 0.6rem 0.75rem;
  background: #f8f8fa;
  border-radius: 10px;
}

.selected-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.78rem;
}

.selected-file-item:not(:last-child) {
  border-bottom: 1px solid #eee;
}

.selected-file-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1d1d1f;
}

.selected-file-size {
  color: #8e8e93;
  margin-left: 0.5rem;
  flex-shrink: 0;
  font-size: 0.72rem;
}

.selected-file-remove {
  margin-left: 0.4rem;
  background: none;
  border: none;
  color: #c7c7cc;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0 0.2rem;
  line-height: 1;
}

.selected-file-remove:hover {
  color: #ff3b30;
}

/* --- Code section --- */

.code-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f5;
}

.code-section label {
  font-size: 0.72rem;
  color: #8e8e93;
  display: block;
  margin-bottom: 0.35rem;
}

.code-row {
  display: flex;
  gap: 0.5rem;
}

.code-row input {
  flex: 1;
  padding: 0.6rem 0;
  border: none;
  border-bottom: 1.5px solid #e5e5ea;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.25em;
  text-align: center;
  outline: none;
  color: #1d1d1f;
  background: none;
}

.code-row input:focus {
  border-bottom-color: #4f6ef7;
}

.code-row input::placeholder {
  font-weight: 400;
  letter-spacing: 0;
  font-size: 0.85rem;
  color: #c7c7cc;
}

.code-verify-btn {
  padding: 0.5rem 0.9rem;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.code-verify-btn:hover {
  background: #3d5bd9;
}

/* --- Progress --- */

.progress-bar {
  width: 100%;
  height: 5px;
  background: #f0f0f5;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 1rem;
}

.progress-fill {
  height: 100%;
  background: #4f6ef7;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

/* --- Result --- */

.result-box {
  text-align: center;
  padding: 1.25rem 0 0.5rem;
}

.result-box svg {
  margin-bottom: 0.75rem;
}

.result-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1d1d1f;
  margin-bottom: 0.3rem;
}

.link-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.link-row input {
  flex: 1;
  background: #f8f8fa;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
  font-family: inherit;
  color: #8e8e93;
  outline: none;
}

.copy-btn {
  padding: 0.5rem 0.75rem;
  background: #f0f0f5;
  color: #1d1d1f;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #e5e5ea;
}

/* --- Utilities --- */

.error {
  color: #ff3b30;
  font-size: 0.78rem;
  margin-top: 0.6rem;
  text-align: center;
}

.hint {
  color: #8e8e93;
  font-size: 0.78rem;
  margin-top: 0.5rem;
  text-align: center;
}

.meta {
  color: #8e8e93;
  font-size: 0.72rem;
  margin-top: 0.3rem;
}

.center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* --- Responsive --- */

@media (max-width: 440px) {
  body {
    padding: 0 0.75rem 2rem;
  }

  .card {
    padding: 2rem 1.15rem 1.25rem;
  }

  .nav-brand {
    display: none;
  }

  .top-nav {
    padding: 0.7rem 1rem;
    margin: 0 -0.75rem;
    width: calc(100% + 1.5rem);
  }
}
