/* ID Photo Maker — page-specific styles.
   Builds on the shared classes in common.css and image.css. */

/* ------------------------------------------------------------------ */
/* Workbench layout                                                    */
/* ------------------------------------------------------------------ */
.id-photo-workbench {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 18px;
    align-items: start;
}

@media (max-width: 960px) {
    .id-photo-workbench {
        grid-template-columns: 1fr;
    }
}

.id-photo-card {
    background: #fff;
    border: 1px solid var(--image-border, #e3e8f0);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(16, 32, 60, 0.06);
}

.id-photo-card h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: #1d3a6e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.id-photo-card h2 i {
    color: #ff4d4d;
}

.id-photo-hint {
    color: #6b7688;
    font-size: 0.85rem;
    margin: 4px 0 10px;
}

/* Dropzone & preview ------------------------------------------------ */
.id-photo-dropzone {
    border: 2px dashed #c9d4e5;
    border-radius: 12px;
    padding: 26px 14px;
    text-align: center;
    color: #6b7688;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #f8fafd;
}

.id-photo-dropzone:hover,
.id-photo-dropzone.is-drag {
    border-color: #ff4d4d;
    background: #fff5f5;
}

.id-photo-dropzone i {
    font-size: 1.7rem;
    color: #ff4d4d;
    display: block;
    margin-bottom: 8px;
}

.id-photo-dropzone strong {
    display: block;
    color: #1c2330;
    margin-bottom: 4px;
}

.id-photo-preview {
    margin-top: 12px;
    text-align: center;
}

.id-photo-preview:empty {
    display: none;
}

.id-photo-preview img {
    max-width: 100%;
    max-height: 230px;
    border-radius: 10px;
    border: 1px solid #e3e8f0;
}

.id-photo-preview-meta {
    color: #6b7688;
    font-size: 0.8rem;
    margin-top: 6px;
}

/* Settings form ------------------------------------------------------ */
.id-photo-fields {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.id-photo-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.id-photo-field-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

@media (max-width: 560px) {
    .id-photo-field-row,
    .id-photo-field-row-3 {
        grid-template-columns: 1fr;
    }
}

.id-photo-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0;
    min-width: 0;
}

.id-photo-field > span {
    font-size: 0.78rem;
    color: #6b7688;
}

.id-photo-field select,
.id-photo-field input {
    padding: 8px 10px;
    border: 1px solid #d7dfeb;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 100%;
    background: #fff;
    color: #1c2330;
}

.id-photo-field input:focus,
.id-photo-field select:focus {
    outline: 2px solid rgba(255, 77, 77, 0.25);
    border-color: #ff4d4d;
}

.id-photo-checks {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 12px 0;
}

.id-photo-checks label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 0.9rem;
}

.id-photo-details {
    border-top: 1px dashed #e3e8f0;
    margin-top: 12px;
    padding-top: 10px;
}

.id-photo-details summary {
    cursor: pointer;
    color: #1d3a6e;
    font-size: 0.9rem;
    font-weight: 600;
}

.id-photo-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.id-photo-make-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    background: linear-gradient(120deg, #ff4d4d, #e11d48);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.id-photo-make-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.id-photo-make-btn:hover:not(:disabled) {
    filter: brightness(1.05);
}

/* Log & progress ----------------------------------------------------- */
.id-photo-log {
    max-height: 190px;
    overflow-y: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.75rem;
    background: #f8fafd;
    border: 1px solid #e3e8f0;
    color: #44506a;
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.id-photo-log .ok { color: #16a34a; }
.id-photo-log .warn { color: #d97706; }
.id-photo-log .err { color: #dc2626; }

.id-photo-progress {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.id-photo-download {
    font-size: 0.78rem;
}

.id-photo-download-name {
    display: flex;
    justify-content: space-between;
    color: #6b7688;
    margin-bottom: 3px;
}

.id-photo-download-pct {
    color: #1d3a6e;
    font-weight: 600;
}

.id-photo-download-track {
    height: 8px;
    background: #eef1f6;
    border-radius: 999px;
    overflow: hidden;
}

.id-photo-download-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff4d4d, #f59e0b);
    transition: width 0.2s;
}

.id-photo-download.is-done .id-photo-download-fill {
    background: #16a34a;
}

/* Results ------------------------------------------------------------ */
.id-photo-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.id-photo-results .id-photo-empty {
    grid-column: 1 / -1;
    color: #6b7688;
    text-align: center;
    padding: 34px 0;
    margin: 0;
}

.id-photo-result {
    margin: 0;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fafbfe;
}

.id-photo-result figcaption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #f0f4fb;
    color: #1c2330;
}

.id-photo-download-btn {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 7px;
    border: 1px solid #ff4d4d;
    background: #fff;
    color: #e11d48;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.id-photo-download-btn:hover {
    background: #fff5f5;
}

.id-photo-result img {
    display: block;
    width: 100%;
    height: auto;
}

/* Model note --------------------------------------------------------- */
.id-photo-model-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #f0f5ff;
    border: 1px solid #c8d9ff;
    border-radius: 10px;
    padding: 10px 12px;
    color: #33507e;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.id-photo-model-note i {
    margin-top: 2px;
}

/* Toast -------------------------------------------------------------- */
.id-photo-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 20px);
    background: #1c2330;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.88rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 999;
    max-width: min(90vw, 560px);
    text-align: center;
}

.id-photo-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
