:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #66706b;
  --paper: #fffdf9;
  --canvas: #f4f1eb;
  --line: #dedbd3;
  --green: #185b43;
  --green-dark: #114632;
  --green-soft: #e2eee7;
  --danger: #9c2f2f;
  --danger-soft: #f9e8e6;
  --shadow: 0 24px 64px rgba(29, 42, 36, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.95), transparent 34rem),
    var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

.shell {
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.upload-card {
  width: min(100%, 520px);
  padding: 28px 22px 22px;
  border: 1px solid rgba(24, 32, 29, 0.08);
  border-radius: 28px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 14px;
  background: var(--green);
  transform: rotate(-3deg);
}

.brand-mark span {
  width: 20px;
  height: 16px;
  position: relative;
  display: block;
  border: 2px solid #fff;
  border-radius: 5px;
}

.brand-mark span::before {
  content: "";
  width: 8px;
  height: 4px;
  position: absolute;
  top: -6px;
  left: 4px;
  border-radius: 2px 2px 0 0;
  background: #fff;
}

.brand-mark span::after {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  inset: 0;
  margin: auto;
  border: 2px solid #fff;
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 410px;
  font-size: clamp(2.35rem, 11vw, 3.6rem);
}

h2 {
  font-size: clamp(2rem, 9vw, 2.75rem);
}

.intro {
  max-width: 430px;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.choice-grid {
  display: grid;
  gap: 12px;
}

.choice-button {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.choice-button:active {
  transform: scale(0.985);
}

.choice-button--primary {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(24, 91, 67, 0.18);
}

.choice-button strong,
.choice-button small {
  display: block;
}

.choice-button strong {
  margin-bottom: 4px;
  font-size: 1rem;
}

.choice-button small {
  color: var(--muted);
  font-size: 0.81rem;
}

.choice-button--primary small {
  color: rgba(255, 255, 255, 0.72);
}

.camera-icon,
.gallery-icon {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--green-soft);
}

.choice-button--primary .camera-icon {
  background: rgba(255, 255, 255, 0.13);
}

.camera-icon::before {
  content: "";
  width: 20px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.camera-icon::after {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.camera-icon i {
  width: 8px;
  height: 4px;
  position: absolute;
  top: 10px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
}

.gallery-icon {
  color: var(--green);
}

.gallery-icon::before {
  content: "";
  width: 21px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.gallery-icon::after {
  content: "";
  width: 4px;
  height: 4px;
  position: absolute;
  top: 11px;
  right: 11px;
  border-radius: 50%;
  background: currentColor;
}

.gallery-icon i {
  width: 16px;
  height: 9px;
  position: absolute;
  bottom: 10px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg) skew(-8deg, -8deg);
}

.hint {
  margin: 16px 0 0;
  color: #7e8682;
  font-size: 0.76rem;
  text-align: center;
}

.preview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.text-button {
  padding: 8px 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
}

.preview-frame {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  background: #e7e5df;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.file-details {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 2px 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  flex: 0 0 auto;
}

.upload-button,
.secondary-button {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.upload-button:hover,
.upload-button:focus-visible {
  background: var(--green-dark);
}

.upload-button:active,
.secondary-button:active {
  transform: scale(0.985);
}

.upload-button:disabled {
  cursor: wait;
  opacity: 0.84;
}

.upload-button__loader {
  width: 18px;
  height: 18px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.upload-button.is-loading .upload-button__loader {
  display: block;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  margin: 12px 8px 0;
  border-radius: 99px;
  background: #dce3df;
}

.progress-track span {
  width: 45%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--green);
  animation: progress 1.25s ease-in-out infinite;
}

.success-view {
  padding: 16px 2px 4px;
  text-align: center;
}

.success-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-size: 2.1rem;
  font-weight: 800;
}

.success-view p:not(.eyebrow) {
  max-width: 350px;
  margin: 16px auto 26px;
  color: var(--muted);
  line-height: 1.55;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.status-message {
  margin-top: 15px;
  padding: 12px 14px;
  border-radius: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.4;
}

footer {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin-top: 24px;
  color: #858c88;
  font-size: 0.7rem;
  line-height: 1.45;
  text-align: center;
}

.lock-icon {
  width: 9px;
  height: 8px;
  flex: 0 0 9px;
  position: relative;
  margin-top: 3px;
  border-radius: 2px;
  background: currentColor;
}

.lock-icon::before {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  top: -5px;
  left: 2px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.choice-button:has(+ .visually-hidden:focus-visible),
.choice-button:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(24, 91, 67, 0.3);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes progress {
  0% { transform: translateX(-120%); }
  50% { transform: translateX(85%); }
  100% { transform: translateX(240%); }
}

@media (min-width: 640px) {
  .upload-card {
    padding: 40px 42px 28px;
  }
}

@media (max-height: 700px) and (orientation: landscape) {
  .shell {
    place-items: start center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
