/* =========================================================
   GOS112 v1 - Photos display
   Controls uploaded dog photos in confirmation and public page
   ========================================================= */

/* General safety: images should never overflow their container */
img {
  max-width: 100%;
  height: auto;
}

/* Confirmation page: /alerta/creada */
.created-alert-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 220px));
  gap: 12px;
  margin: 1rem 0;
  align-items: start;
}

.created-alert-photo-wrap {
  width: 100%;
  max-width: 220px;
  height: 180px;
  background: #f4f4f2;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uploaded-photo-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Public alert page: /alerta/{uuid} */
.public-alert-photos {
  display: grid;
  gap: 16px;
  margin: 1rem 0;
}

.public-alert-photo-wrap {
  width: 100%;
  max-width: 640px;
  max-height: 520px;
  background: #f4f4f2;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.alert-photo-main {
  width: 100%;
  max-width: 640px;
  max-height: 520px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Compatibility with the old generic grid, just in case it is used elsewhere */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 220px));
  gap: 12px;
  margin: 1rem 0;
}

.photo-grid img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background: #f4f4f2;
}

@media (max-width: 700px) {
  .public-alert-photo-wrap,
  .alert-photo-main {
    max-width: 100%;
    max-height: 420px;
  }

  .created-alert-photos-grid,
  .photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .created-alert-photo-wrap {
    max-width: 100%;
  }
}


/* GOS112 v1 - status boxes */
.success-box {
  border-left-color: #1f8f3a;
  background: #ecf8ef;
}

.primary-action {
  margin: 1rem 0;
}

/* GOS112 v1 - private management actions */
.management-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 1rem 0 1.5rem;
}

.management-actions form {
  display: inline-block;
  margin: 0;
}


/* GOS112 v1 - public history register */
.history-register {
  margin: 1.25rem 0 0;
  display: grid;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
}

.history-line {
  padding: 8px 0;
  border-bottom: 1px solid #ecece6;
  overflow-wrap: anywhere;
}

.history-line:last-child {
  border-bottom: 0;
}

/* Closed cases: keep only a small thumbnail visible */
.public-alert-photos-closed {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.public-alert-thumb-wrap {
  display: inline-block;
  background: #f4f4f2;
  border-radius: 8px;
  padding: 4px;
}

.alert-photo-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

/* =========================================================
   GOS112 v1 - Public UX and form clarity
   This layer improves copy, hierarchy and mobile readability only.
   No alert, privacy or data-flow behaviour is changed here.
   ========================================================= */

.eyebrow {
  margin: 0 0 0.35rem;
  color: #5f5f58;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.intro {
  max-width: 62ch;
  margin: -0.35rem 0 1.5rem;
  color: #444;
  font-size: 1.08rem;
}

.form-card form {
  gap: 1.4rem;
}

.form-section {
  margin: 0;
  padding: 1.15rem 0 0;
  border: 0;
  border-top: 1px solid #e6e6df;
}

.form-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.form-section legend {
  padding: 0;
  margin: 0 0 0.9rem;
  font-size: 1.12rem;
  font-weight: 800;
}

.step-number {
  display: inline-flex;
  width: 1.65rem;
  height: 1.65rem;
  align-items: center;
  justify-content: center;
  margin-right: 0.42rem;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 0.86rem;
}

.required {
  color: #555;
  font-size: 0.78rem;
  font-weight: 700;
}

.form-section-help {
  margin: -0.25rem 0 0.9rem;
}

.compact-section {
  padding-bottom: 0.2rem;
}

.error-box {
  padding: 0.8rem 0.95rem;
  border-left: 4px solid #b00020;
  background: #fff0f2;
  color: #850018;
  font-weight: 700;
}

.privacy-box {
  background: #f2f5ff;
  border-left-color: #4968b2;
}

.submit-area {
  padding-top: 0.1rem;
}

.submit-area > p {
  margin: 0;
}

.private-link-box,
.close-case-box,
.sighting-action {
  margin: 1.5rem 0;
  padding: 1.15rem;
  border-radius: 12px;
  background: #f5f5ef;
}

.private-link-box h2,
.close-case-box h2,
.sighting-action h2 {
  margin-bottom: 0.4rem;
}

.copy-link-label {
  margin: 1rem 0 0;
}

.copy-link-label input {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.copy-status {
  min-height: 1.3em;
  margin: 0.25rem 0 0;
}

.sighting-action p {
  margin-top: 0.15rem;
}

@media (max-width: 640px) {
  .card {
    padding: 21px;
  }

  .intro {
    font-size: 1rem;
  }

  .private-link-box,
  .close-case-box,
  .sighting-action {
    padding: 1rem;
  }
}


/* GOS112 v1 - mobile correction and consent clarity */
.create-alert-card,
.form-card,
.form-section,
.form-section label,
.private-link-box,
.close-case-box,
.sighting-action,
.private-contacts-box {
  min-width: 0;
}

.form-card input,
.form-card select,
.form-card textarea,
.copy-link-label input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.public-alert-card .dog-name {
  font-weight: 850;
  letter-spacing: 0.01em;
}

.dog-name-inline {
  font-weight: 800;
}

.private-contacts-box {
  margin: 1.5rem 0;
  padding: 1.15rem;
  border-radius: 12px;
  background: #f5f5ef;
}

.private-contacts-box h2 {
  margin-bottom: 0.4rem;
}

.private-contact-list {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.private-contact-list li {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: baseline;
  padding-top: 0.55rem;
  border-top: 1px solid #dfdfd8;
}

.private-contact-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.checkbox-line .muted {
  font-weight: 400;
}

@media (max-width: 640px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .form-card {
    padding: 18px;
  }

  .form-section legend {
    font-size: 1.04rem;
  }

  .form-card input,
  .form-card select,
  .form-card textarea {
    font-size: 16px;
  }
}


/* Keep the four questions visually distinct, especially on narrow screens. */
.create-alert-card .form-section:not(:first-of-type) {
  margin-top: 1.55rem;
}

.create-alert-card .form-section legend {
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .create-alert-card .form-section:not(:first-of-type) {
    margin-top: 1.8rem;
  }
}

/* GOS112 v1 - private geolocation, coverage groundwork and consent layout */
.location-helper,
.coverage-box {
  margin: 0 0 1.1rem;
  padding: 1rem;
  border: 1px solid #deded7;
  border-radius: 12px;
  background: #f8f8f4;
}

.location-helper h2,
.coverage-box h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.location-helper p,
.coverage-box p {
  margin: 0.25rem 0 0.8rem;
}

.location-button {
  width: auto;
  max-width: 100%;
}

.location-status {
  min-height: 1.3em;
  margin: 0.75rem 0 0.2rem;
}

.location-status.ok { color: #107c10; font-weight: 700; }
.location-status.bad { color: #b00020; font-weight: 700; }

.no-coverage-box {
  background: #fff8e5;
  border-color: #e0c16b;
}

.coverage-list {
  margin: 0.75rem 0;
  padding-left: 1.15rem;
}

.coverage-list li + li { margin-top: 0.35rem; }

.copy-link-label textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  resize: vertical;
}

/* Checkbox input must be exempt from the generic 100% input width rule. */
.form-card .checkbox-line input[type="checkbox"] {
  width: 1.1rem;
  min-width: 1.1rem;
  max-width: 1.1rem;
  height: 1.1rem;
  margin: 0.2rem 0 0;
  padding: 0;
  accent-color: #111;
}

.consent-line {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  column-gap: 0.7rem;
  align-items: start;
  cursor: pointer;
}

.consent-copy {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
}

.consent-line .error {
  grid-column: 2;
}

@media (max-width: 640px) {
  .location-helper,
  .coverage-box { padding: 0.9rem; }
  .location-button { width: 100%; }
}




/* =========================================================
   GOS112 v1 – form structure and location reference quality
   Field wrappers, not stacked margin overrides. This is deliberate:
   each question must remain visually separate on a narrow mobile screen.
   ========================================================= */
.form-card .form-section {
  display: block;
  margin: 0;
  padding: 1.55rem 0 0;
}
.form-card .form-section:first-of-type {
  padding-top: 0;
}
.form-card .form-section legend {
  margin: 0 0 1.35rem;
}
.form-card .form-field {
  margin: 0 0 2rem;
}
.form-card .form-field:last-child {
  margin-bottom: 0;
}
.form-card .form-field > label {
  display: grid;
  gap: 0;
  margin: 0;
  font-weight: 750;
  line-height: 1.28;
}
.form-card .form-field > label > input,
.form-card .form-field > label > select,
.form-card .form-field > label > textarea {
  margin-top: 0.6rem;
}
.form-card .form-field .muted,
.form-card .form-field > label > small.muted,
.form-card .form-section-help {
  display: block;
  margin: 0.62rem 0 0;
  color: #7a7d76;
  font-size: 0.91rem;
  font-weight: 400;
  line-height: 1.45;
}
.form-card .form-section-help {
  margin: -0.25rem 0 1.6rem;
  color: #747870;
}
.form-card .form-field > label > .error {
  margin-top: 0.6rem;
}
.form-card .form-field.consent-field {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}
.form-card .form-field .checkbox-line {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid #dfdfd7;
  border-radius: 10px;
  background: #fafaf7;
}
.form-card .form-field .checkbox-line input[type="checkbox"] {
  width: auto;
  min-width: 1.05rem;
  height: 1.05rem;
  margin: 0.18rem 0 0;
}
.form-card .form-field .checkbox-line .consent-copy {
  line-height: 1.42;
}
.form-card .form-field .checkbox-line .consent-copy small {
  margin-top: 0.45rem;
}
.location-helper,
.location-preview,
.coverage-box {
  margin: 0 0 2rem;
  padding: 1.05rem;
  border-radius: 12px;
}
.location-helper { border: 1px solid #deded7; background: #f8f8f4; }
.location-helper h2 { margin: 0 0 0.35rem; font-size: 1.02rem; }
.location-helper p { margin: 0.35rem 0 0; }
.location-helper .location-button { margin-top: 0.95rem; }
.location-status { min-height: 1.35em; margin: 0.8rem 0 0; }
.location-status.bad { color: #9d1c1c; font-weight: 700; }
.location-status.ok { color: #28722e; font-weight: 700; }
.location-preview { border: 1px solid #9cb897; border-left: 4px solid #2d7d33; background: #eef8ef; }
.location-preview[hidden] { display: none; }
.location-preview.needs-detail { border-color: #e4c36e; border-left-color: #b27b08; background: #fff8e7; }
.location-preview-kicker { margin: 0 0 0.35rem; font-size: 0.86rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }
.location-preview-label { margin: 0; font-size: 1.06rem; font-weight: 800; line-height: 1.32; }
.location-preview .muted,
.location-detail-note { margin: 0.65rem 0 0; }
.location-detail-note { color: #6e5c2d; line-height: 1.42; }
.location-preview .compact-button { width: auto; margin-top: 0.9rem; }
.share-preview {
  padding: 1rem;
  border: 1px solid #d7d7d0;
  border-radius: 12px;
  background: #fff;
  color: #292929;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.share-package-source { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.share-actions { margin-top: 1rem; }
@media (max-width: 640px) {
  .form-card .form-section { padding-top: 1.8rem; }
  .form-card .form-section legend { margin-bottom: 1.45rem; }
  .form-card .form-field { margin-bottom: 2.3rem; }
  .form-card .form-field > label > input,
  .form-card .form-field > label > select,
  .form-card .form-field > label > textarea { margin-top: 0.65rem; }
  .form-card .form-field .muted,
  .form-card .form-field > label > small.muted,
  .form-card .form-section-help { font-size: 0.89rem; }
  .location-helper, .location-preview, .coverage-box { margin-bottom: 2.25rem; padding: 1rem; }
  .share-actions { display: grid; grid-template-columns: 1fr; gap: 0.7rem; }
  .share-actions .button { width: 100%; text-align: center; }
}
