﻿/* ============================================================
   SCALA FLUIDA
============================================================ */
:root {
    --scale: 1;
}

/* ============================================================
   WRAPPER GENERALE
============================================================ */
.register-wrapper {
    margin-top: calc(1.2rem * var(--scale));
    display: flex;
    justify-content: center;
    height: auto;
    overflow: hidden;
}

/* ============================================================
   CARD
============================================================ */
.register-card {
    width: 100%;
    max-width: 900px;
    background: #faf9f7;
    border: 1px solid #e0dedb;
    border-radius: 0.75rem;
    padding: calc(2.5em * var(--scale)) calc(2em * var(--scale));
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    font-size: calc(1rem * var(--scale));
}

/* ============================================================
   HEADER
============================================================ */
.register-header {
    background: linear-gradient(to bottom, #ffffff, #f4f3f1);
    padding: calc(1em * var(--scale)) calc(1.5em * var(--scale));
    margin: calc(-2.5em * var(--scale)) calc(-2em * var(--scale)) 1em calc(-2em * var(--scale));
    border-bottom: 1px solid #e0dedb;
    border-radius: 0.75rem 0.75rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .register-header h3 {
        font-weight: 600;
        color: #2c3e50;
        letter-spacing: 0.5px;
        margin: 0;
        font-size: 1.6em;
    }

.header-actions button {
    width: 2.4em;
    height: 2.4em;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================================
   FORM LAYOUT
============================================================ */
.form-row-3,
.form-row-2,
.form-row-birth-others,
.form-row-3-mini {
    gap: 1.25em;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 0.475fr 0.475fr;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.form-row-birth-others {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.form-row-3-mini {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

/* ============================================================
   DATA DI NASCITA
============================================================ */
.birth-block .d-flex {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5em;
}

/* ============================================================
   INPUT SCALING
============================================================ */
.register-card .form-control,
.register-card .form-select {
    font-size: 1em;
    padding: 0.55em 0.75em;
}

/* ============================================================
   SELECT
============================================================ */
.select-wrapper .form-select {
    background-image: none !important;
    padding-right: 2rem;
}

.select-wrapper {
    width: 100%;
    display: block;
}

    .select-wrapper .form-select {
        width: 100%;
    }

/* ============================================================
   BREAKPOINTS
============================================================ */
@media (max-width: 575px) {
    :root {
        --scale: 0.80;
    }

    .form-row-3,
    .form-row-2,
    .form-row-birth-others,
    .form-row-3-mini {
        grid-template-columns: 1fr;
    }

    .birth-block .d-flex {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .register-wrapper {
        margin-top: calc(1.2rem * var(--scale));
        height: auto;
        overflow: visible;
    }
}

.register-card .form-label {
    margin-bottom: 0.2rem;
}

/* ============================================================
   FOOTER
============================================================ */
@media (max-height: 850px), (max-width: 575px) {
    .sticky-footer {
        display: none !important;
    }
}

/* ============================================================
   READONLY
============================================================ */
input[readonly].form-control {
    background-color: #f7f7f7;
}

/* ============================================================
   IMMAGINE PROFILO
============================================================ */
.profile-row {
    display: flex;
    gap: 0.5rem;
}

    .profile-row .form-control {
        flex: 1;
    }

.image-preview {
    width: 64px;
    height: 64px;
    border: 1px solid #e0dedb;
    background: #fafafa;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}

    .image-preview img {
        width: 64px;
        height: 64px;
        object-fit: cover;
    }

#previewIcon {
    font-size: 2.5rem;
    color: #999;
}

@media (max-width: 575px), (max-height: 575px) {
    .image-preview {
        width: 40px;
        height: 40px;
    }

        .image-preview img {
            width: 40px;
            height: 40px;
        }

    #previewIcon {
        font-size: 1.2rem;
    }
}

/* ============================================================
   BADGE CIRCLE (ANTEPRIMA PROFILO)
============================================================ */
.badge-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px lightgray;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
    margin-left: 4px !important;
    background: snow;
}

    .badge-circle img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

#searchImageLbl {
    margin-bottom: 2px !important;
}

#previewBox {
    margin-left: 4px !important;
    margin-top: 26px !important;
}

/* Desktop >1200px */
@media (min-width: 1200px) {
    .badge-circle {
        width: 64px;
        height: 64px;
    }

        .badge-circle.home {
            width: 48px;
            height: 48px;
        }
}

/* 757–1199px */
@media (max-width: 1199px) and (min-width: 757px) {
    .badge-circle {
        width: 56px;
        height: 56px;
    }

        .badge-circle.home {
            width: 32px;
            height: 32px;
        }
}

/* ≤700px */
@media (max-width: 567px) {
    .badge-circle {
        width: 48px;
        height: 48px;
    }

        .badge-circle.home {
            width: 24px;
            height: 24px;
        }
}

/* ≤576px */
@media (max-width: 576px) {
    .badge-circle {
        width: 34px;
        height: 34px;
        transform: translate(0.4rem, -0.1rem);
    }
}
/* ============================================================
   DYNAMIC SECTIONS
============================================================ */
.dynamic-section {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dynamic-box {
    border: 1px solid #e0dedb;
    background: #fafafa;
    padding: 1rem;
    border-radius: 0.5rem;
}

.dynamic-box-slim-mex {
    border: 1px solid #e0dedb;
    /*border-left-width: 0.5rem;*/ /* 🔥 bordo sinistro spesso */
    /*border-left-color: #dc3545;*/ /* oppure un colore a tua scelta */
    background: linear-gradient( to right, rgba(255, 200, 200, 0.35), rgba(255, 150, 150, 0.35) );
    border-radius: 0.5rem;
    margin-top: 1rem;
    padding: 4px;
}

.dynamic-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: 100%;
}

.dynamic-col-fixed {
    flex: 0 0 auto;
}

.dynamic-col-grow {
    flex: 1 1 auto;
    min-width: 0;
}

.btn-crud {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}


/* Default: col-10 (Bootstrap gestisce tutto) */

/* Mobile: <576px */
@media (max-width: 575.98px) {
    .user-col {
        width: calc(75% + 1rem) !important; /* 9/12 = 75% */
        flex: 0 0 calc(75% + 1rem) !important;
        max-width: calc(75% + 1rem) !important;
    }
}
