/* =============================================================================
   Progenia Feeds Form – form.css
   Matches the design from the screenshot (progenia.ch style)
   ============================================================================= */

/* ---- Wrapper ---- */
.pff-wrap {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
}

/* ---- Notices ---- */
.pff-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}
.pff-success {
    background-color: #eafaf1;
    border: 1px solid #27ae60;
    color: #1e8449;
}
.pff-error {
    background-color: #fdf3f3;
    border: 1px solid #e74c3c;
    color: #c0392b;
}

/* ---- Form ---- */
.pff-form {
    padding: 0;
}

/* ---- Generic field wrapper ---- */
.pff-field {
    margin-bottom: 20px;
}

/* ---- Labels ---- */
.pff-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 400;
    color: #444;
}
.pff-label-hint {
    font-weight: 400;
    color: #666;
}
.pff-required {
    color: #e74c3c;
    margin-left: 2px;
}

/* ---- Photo row ---- */
.pff-photo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pff-no-image {
    font-size: 14px;
    color: #555;
}
/* Hide the native file input */
.pff-input-file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}
/* Teal "Bild hinzufügen" button */
.pff-photo-btn {
    display: inline-block;
    padding: 0;
    color: #00a99d;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
}
.pff-photo-btn:hover {
    text-decoration: underline;
}

/* ---- Image preview ---- */
.pff-photo-preview {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}
.pff-photo-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
}
.pff-remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}
.pff-remove-photo:hover {
    background: #c0392b;
}

/* ---- Text input ---- */
.pff-input-text {
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s;
}
.pff-input-text:focus {
    border-color: #00a99d;
    box-shadow: 0 0 0 2px rgba(0,169,157,.15);
}

/* ---- Textarea ---- */
.pff-textarea {
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    box-sizing: border-box;
    resize: vertical;
    outline: none;
    transition: border-color .15s;
}
.pff-textarea:focus {
    border-color: #00a99d;
    box-shadow: 0 0 0 2px rgba(0,169,157,.15);
}

/* ---- Character counter ---- */
.pff-char-count {
    text-align: right;
    font-size: 12px;
    color: #888;
    margin: 4px 0 0;
}
.pff-char-count.pff-over-limit {
    color: #e74c3c;
    font-weight: 600;
}

/* ---- Select ---- */
.pff-select {
    display: block;
    width: 100%;
    padding: 8px 30px 8px 10px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    box-sizing: border-box;
    appearance: auto;
    outline: none;
    transition: border-color .15s;
}
.pff-select:focus {
    border-color: #00a99d;
    box-shadow: 0 0 0 2px rgba(0,169,157,.15);
}

/* ---- Submit button ---- */
.pff-submit-wrap {
    margin-top: 10px;
}
.pff-btn-submit {
    display: inline-block;
    padding: 12px 24px;
    background-color: #1a5276;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .04em;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color .2s;
}
.pff-btn-submit:hover,
.pff-btn-submit:focus {
    background-color: #154360;
    outline: none;
}
.pff-btn-submit:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}


/* =============================================================================
   Crop Modal – CropperJS overlay
   ============================================================================= */

/* Empêche le scroll du body quand la modale est ouverte */
body.pff-crop-open {
    overflow: hidden;
}

/* Fond semi-transparent */
.pff-crop-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Boîte blanche */
.pff-crop-modal {
    background: #fff;
    border-radius: 4px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

/* Titre */
.pff-crop-title {
    margin: 0;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

/* Zone de crop */
.pff-crop-container {
    flex: 1;
    overflow: hidden;
    background: #1a1a1a;
    min-height: 300px;
    max-height: 60vh;
    position: relative;
}

.pff-crop-container img {
    /* CropperJS gère le display */
    display: block;
    max-width: 100%;
}

/* Boutons d'action */
.pff-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.pff-btn-crop-cancel {
    padding: 8px 18px;
    font-size: 14px;
    background: #fff;
    color: #555;
    border: 1px solid #ccc;
    border-radius: 0;
    cursor: pointer;
    transition: background .15s;
}
.pff-btn-crop-cancel:hover {
    background: #f5f5f5;
}

.pff-btn-crop-apply {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    background: #00a99d;
    color: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background .2s;
}
.pff-btn-crop-apply:hover,
.pff-btn-crop-apply:focus {
    background: #008a80;
    outline: none;
}

/* Responsive : modale plein écran sur mobile */
@media ( max-width: 480px ) {
    .pff-crop-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .pff-crop-container {
        max-height: 55vh;
    }
}
