* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6fa;
  color: #102433;
}

.container {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.card {
  width: 100%;
  max-width: 720px;
  background: #ffffff;
  border-radius: 24px;
  padding: 34px 34px 28px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.logo {
  width: 230px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.heading {
  text-align: center;
  margin-bottom: 24px;
}

h1, h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.1;
  color: #0e2340;
}

.subtitle {
  margin: 0;
  color: #53657f;
  font-size: 16px;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cfd7e3;
  border-radius: 14px;
  font-size: 16px;
  background: #fff;
  color: #102433;
}

input[type="text"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: #1b9a59;
  box-shadow: 0 0 0 3px rgba(27, 154, 89, 0.12);
}

.help,
small {
  color: #5b6b80;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
}

.success-text {
  color: #1f7a43;
}

.error-text {
  color: #b42318;
}

.hidden {
  display: none !important;
}

.hidden-input {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.capture-actions,
.camera-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.top-gap {
  margin-top: 18px;
}

.secondary-btn,
.ghost-btn,
.submit-btn,
.link-btn {
  border: 0;
  border-radius: 16px;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  text-align: center;
}

.secondary-btn,
.submit-btn,
.link-btn.secondary-btn {
  background: #1b9a59;
  color: #fff;
}

.secondary-btn:hover,
.submit-btn:hover,
.link-btn.secondary-btn:hover {
  opacity: 0.96;
  transform: translateY(-1px);
}

.ghost-btn,
.link-btn.ghost-btn {
  background: #e9eef4;
  color: #18324b;
}

.ghost-btn:hover,
.link-btn.ghost-btn:hover {
  opacity: 0.96;
}

.submit-btn {
  width: 100%;
}

.preview-box {
  margin-top: -6px;
}

.preview-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview {
  width: 100%;
  max-width: 180px;
  border-radius: 16px;
  border: 1px solid #d8dfeb;
  display: block;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  font-weight: 500;
  font-size: 15px;
  text-align: left;
}

.checkbox-row input {
  margin-top: 4px;
  flex-shrink: 0;
}

.checkbox-row span {
  text-align: left;
  line-height: 1.4;
}

.result {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
}

.result.success {
  background: #e8f4ed;
  color: #10633b;
}

.result.error {
  background: #fdecec;
  color: #a12222;
}

.tips {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 8px;
  padding: 18px;
  background: #f7faf8;
  border: 1px solid #dbe9e0;
  border-radius: 18px;
}

.tip-item {
  color: #23425f;
  line-height: 1.5;
  font-size: 15px;
}

.camera-stage,
.captured-stage {
  margin-top: 20px;
}

.camera-frame-wrap {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 3 / 4;
  margin: 0 auto 14px auto;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.camera-frame-overlay {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  pointer-events: none;
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.10);
}

.captured-image {
  width: 100%;
  max-width: 320px;
  border-radius: 18px;
  border: 1px solid #d8dfeb;
  display: block;
  margin: 0 auto 14px auto;
}

.centered-image {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.portrait-preview {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.capture-container {
  min-height: 100vh;
}

.capture-fullpage {
  max-width: 760px;
}

.success-screen {
  text-align: center;
  padding-top: 42px;
  padding-bottom: 34px;
}

.success-logo {
  width: 250px;
}

.success-content {
  margin-top: 10px;
}

.success-content h2 {
  font-size: 42px;
  margin-bottom: 14px;
  color: #0e2340;
}

.success-text-main {
  max-width: 520px;
  margin: 0 auto;
  color: #4d6077;
  font-size: 18px;
  line-height: 1.6;
}

.success-footer {
  margin-top: 28px;
  font-size: 13px;
  color: #6b7c8f;
}

.success-footer span {
  font-family: monospace;
  color: #3f5165;
}

@media (max-width: 640px) {
  .card {
    padding: 26px 20px 22px;
    border-radius: 20px;
  }

  .logo {
    width: 190px;
  }

  .success-logo {
    width: 210px;
  }

  h1, h2 {
    font-size: 24px;
  }

  .success-content h2 {
    font-size: 34px;
  }

  .success-text-main {
    font-size: 16px;
  }

  .capture-actions,
  .camera-actions {
    flex-direction: column;
  }

  .secondary-btn,
  .ghost-btn,
  .link-btn {
    width: 100%;
  }
}
