/* attribute-review-card.css — "Looks right?" detection confirmation card.
 *
 * The component is mounted INSIDE .form-main, which already provides the
 * outer card chrome (background + border + radius + shadow). Don't add a
 * second card here — render plain content. */

/* Review mode shrinks the host card so the rows feel snug instead of
 * floating in an ocean of whitespace on wide screens. */
body.aipet-review-mode .form-main {
    max-width: 560px;
    margin: 0 auto;
}

/* Collapse the two-column form layout to a single centred column. The
 * default .form-layout grid is `1fr 340px` for the main + sidebar pair;
 * with the sidebar hidden in review mode that leaves .form-main pinned
 * to the left of the page, with a 340px gap to its right. Overriding
 * the template-columns rebalances the grid so .form-main sits in the
 * visual centre. */
body.aipet-review-mode .form-layout {
    grid-template-columns: 1fr !important;
    justify-items: center;
}

/* Suppress any legacy form chrome that the multi-step form may still try
 * to render. !important defeats the inline style serialized to those
 * elements by create_project_2.js's showStep() helper. */
body.aipet-review-mode #mobileStickyNav,
body.aipet-review-mode #formNavigation,
body.aipet-review-mode #keyboardHint,
body.aipet-review-mode #uploadHint,
body.aipet-review-mode .form-progress {
    display: none !important;
}

.aipet-review-header {
    text-align: center;
    margin-bottom: 22px;
}

.attribute-review {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
    background: none;
    border: none;
    box-shadow: none;
}

.attribute-review__copy {
    margin: 0;
    color: var(--color-text-light);
    font-size: 16px;
    line-height: 1.55;
}

/* ─── Rows ──────────────────────────────────────────────────────────── */

.attribute-review__rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attribute-review__row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-bg-alt);
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.attribute-review__row:hover {
    transform: translateY(-1px);
}

.attribute-review__row.is-confident {
    border-color: rgba(39, 174, 96, 0.22);
}
.attribute-review__row.is-soft {
    background: var(--color-warning-light, #fff4d6);
    border-color: var(--color-warning, #d4a24c);
}
.attribute-review__row.is-unknown {
    background: var(--color-bg-alt);
    border-color: var(--color-bg-alt);
}

.attribute-review__icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(232, 184, 109, 0.18);     /* warm primary tint */
    color: var(--color-primary-dark);
    font-size: 18px;
    line-height: 1;
}
.attribute-review__row.is-unknown .attribute-review__icon {
    background: rgba(149, 165, 166, 0.22);
    color: var(--color-text-muted);
}

.attribute-review__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.attribute-review__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.attribute-review__value {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attribute-review__marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    background: var(--color-success-light);
    color: var(--color-success);
    flex-shrink: 0;
}
.attribute-review__row.is-soft .attribute-review__marker {
    background: rgba(243, 156, 18, 0.18);
    color: var(--color-warning, #b8860b);
}
.attribute-review__row.is-unknown .attribute-review__marker {
    background: rgba(149, 165, 166, 0.22);
    color: var(--color-text-muted);
}

/* ─── Edit form ─────────────────────────────────────────────────────── */

.attribute-review__edit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.attribute-review__edit label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
}
.attribute-review__edit input,
.attribute-review__edit select {
    padding: 11px 13px;
    border: 1.5px solid #d8d2c4;       /* darker beige so it's clearly an input */
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: var(--color-white);
    color: var(--color-text);
    font-weight: 500;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    appearance: none;
    -webkit-appearance: none;
}
.attribute-review__edit input:hover,
.attribute-review__edit select:hover {
    border-color: var(--color-text-muted);
}
.attribute-review__edit input:focus,
.attribute-review__edit select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.25);
}
.attribute-review__edit input::placeholder {
    color: var(--color-text-muted);
    font-weight: 400;
}
/* Replace the native select chevron we just removed via appearance:none. */
.attribute-review__edit select {
    background-image: linear-gradient(45deg, transparent 50%, var(--color-text-light) 50%),
                      linear-gradient(135deg, var(--color-text-light) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.attribute-review__tips {
    margin: 0;
    padding-left: 18px;
    color: var(--color-text-light);
    font-size: 15px;
    line-height: 1.55;
}

/* ─── Actions ──────────────────────────────────────────────────────── */

.attribute-review__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.attribute-review__primary {
    min-width: 280px;
}
/* When at least one attribute is unknown / low-confidence we lock the
 * confirm CTA and steer the customer to the edit link instead. Saves us
 * from generating a book on attributes we already know are wrong. */
.attribute-review__primary[disabled],
.attribute-review__primary[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
}
.attribute-review__secondary {
    background: none;
    border: none;
    padding: 4px 8px;
    color: var(--color-text-light);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--color-text-muted);
    text-underline-offset: 3px;
    transition: color 150ms ease, text-decoration-color 150ms ease,
                transform 150ms ease;
}
.attribute-review__secondary:hover,
.attribute-review__secondary:focus-visible {
    color: var(--color-primary-dark);
    text-decoration-color: var(--color-primary-dark);
}

/* Forced-edit state — primary CTA is disabled, so this link is the only
 * way forward. Make it look like the new action (accent colour, slightly
 * bolder) and shake to draw the eye. */
.attribute-review__secondary.is-needs-edit {
    color: var(--color-primary-dark, #D4A055);
    text-decoration-color: var(--color-primary-dark, #D4A055);
    font-weight: 600;
    animation: attribute-review-shake 1.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) 600ms 2 both;
}
@keyframes attribute-review-shake {
      0%, 100%  { transform: translateX(0); }
     10%        { transform: translateX(-3px); }
     20%        { transform: translateX(3px); }
     30%        { transform: translateX(-2px); }
     40%        { transform: translateX(2px); }
     50%        { transform: translateX(-1px); }
     60%        { transform: translateX(1px); }
     70%, 90%   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
    .attribute-review__secondary.is-needs-edit { animation: none; }
}

/* Reupload-level visual cues — softer warning for soft, sharper for hard. */
.attribute-review.is-soft-reupload { border-color: var(--color-warning); }
.attribute-review.is-hard-reupload { border-color: var(--color-error); }

/* ─── Mobile ───────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    body.aipet-review-mode .form-main { max-width: 100%; }
    .attribute-review { gap: 14px; }
    .attribute-review__row {
        padding: 12px 14px;
        gap: 12px;
        grid-template-columns: 40px 1fr auto;
    }
    .attribute-review__icon { width: 40px; height: 40px; font-size: 16px; }
    .attribute-review__value { font-size: 16px; }
    .attribute-review__primary { width: 100%; min-width: 0; }
}
