/* =========================================
   BASE & LAYOUT
   ========================================= */

:root {
    --primary-color: #2e7d32;
    --primary-color-hover: #1b5e20;
}

body {
    background-color: #fff8f0;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* =========================================
   NAVBAR
   ========================================= */

.navbar {
    background-color: #c8e6c8;
}

.navbar-nav .nav-link {
    font-size: 1.2rem;
    position: relative;
    text-decoration: none;
}

.navbar-brand {
    position: relative;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
}

.navbar-brand:hover::after {
    width: 90%;
}

.navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #2e7d32;
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after {
    width: 70%;
}

.navBar-logo {
    font-size: 1.7rem;
    color: black;
}

/* =========================================
   BOTTONI
   ========================================= */

.btn-custom {
    background-color: #2e7d32;
    border-color: #2e7d32;
    color: white;
}

.btn-custom:hover {
    background-color: #1b5e20;
    border-color: #1b5e20;
    color: white;
}

.btn-outline-custom {
    color: #2e7d32 !important;
    border: 2px solid #2e7d32 !important;
    background-color: transparent !important;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-outline-custom:hover {
    background-color: transparent !important;
    border: 2px solid #1b5e20 !important;
    color: #1b5e20 !important;
}

.btn-check:checked + .btn-outline-custom {
    background-color: #2e7d32 !important;
    border: 2px solid #2e7d32 !important;
    color: white !important;
}

.btn-check:checked + .btn-outline-custom:hover {
    background-color: #1b5e20 !important;
    border: 2px solid #1b5e20 !important;
    color: white !important;
}

.btn-check:focus + .btn-outline-custom,
.btn-check:focus-visible + .btn-outline-custom {
    box-shadow: none !important;
    outline: none !important;
}

.btn-outline-custom:active {
    border: 2px solid #2e7d32 !important;
}

/* =========================================
   TIPOGRAFIA
   ========================================= */

p,
ul,
li {
    font-size: 1.2rem;
}

h4 {
    color: #2e7d32;
    font-weight: 700;
    font-size: 1.8rem;
}

h1 {
    color: #2e7d32;
    font-weight: 700;
    font-size: 2rem;
}

.display-custom {
    font-family: var(--bs-font-sans-serif);
    font-size: 2.1rem;
    font-weight: 300;
    line-height: 1.2;
}

/* =========================================
   HERO SECTION
   ========================================= */

.hero-section {
    position: relative;
    min-height: 80vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.18) 100%);
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 16px;
    display: inline-block;
    width: 90%;
    max-width: 700px;
    padding: 2.5% 4%;
    height: auto;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* =========================================
   SEZIONI DESCRIZIONE
   ========================================= */

.descrizione {
    min-height: 30vh;
}

.chiSiamo .row > [class*="col-"] {
    padding-left: 0.25rem;
    padding-right: 0.5rem;
}

.cosaFacciamo .img-circle {
    width: 250px;
    height: 250px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
}

.cosaFacciamo .img-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cosaFacciamo h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* =========================================
   FORM STYLING
   ========================================= */

input,
textarea,
select {
    border-width: 1px !important;
    border-color: rgb(50, 50, 50) !important;
}

label {
    font-weight: 600;
}

.form-section {
    background-color: #fff8f0;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #2e7d32;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
    color: #2e7d32;
    font-size: 1.1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

.section-header i {
    font-size: 1.4rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 2px solid #fffbf5;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 0.25rem rgba(46, 125, 50, 0.15);
}

.form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
    opacity: 0.7;
}

.form-text {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-text i {
    color: #2e7d32;
}

.form-control[type="file"] {
    padding: 0.75rem;
    cursor: pointer;
    background-color: #fffbf5;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

.form-control[type="file"]::-webkit-file-upload-button {
    background-color: #2e7d32;
    color: white;
    border: none;
    padding: 0.3rem 1rem;
    border-radius: 6px;
    margin-right: 1rem;
    margin-left: 0;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.form-control[type="file"]::-webkit-file-upload-button:hover {
    background-color: #1b5e20;
    transform: translateX(3px);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    cursor: pointer;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* =========================================
   MODAL (Bootstrap tabs)
   ========================================= */

.modal-body {
    background-color: #fff8f0;
}

.modal-footer {
    background-color: #fff8f0;
    border-top: 2px solid #e9ecef;
}

.modal-footer .btn {
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
}

.modal-footer .btn-outline-secondary {
    border-width: 2px;
}

.modal-footer .btn-custom {
    box-shadow: 0 2px 4px rgba(46, 125, 50, 0.2);
}

.modal-footer .btn-custom:hover {
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.3);
    transform: translateY(-2px);
}

#modalTabs .nav-link {
    color: #555;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    transition:
        color 0.25s,
        border-color 0.25s;
    font-weight: bold;
    font-size: 1rem;
}

#modalTabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-radius: 0;
    border-bottom: 3px solid var(--primary-color);
}

#modalTabs .nav-link:not(.active):hover {
    color: #333;
    background-color: transparent;
    border-radius: 0;
    border-bottom: 3px solid #ccc;
}

/* --- Image Uploader --- */
.post-image-uploader {
    position: relative;
    box-sizing: border-box;
    margin-top: 10px;
    width: 100%;
    padding: 30px 20px;
    border: 2px dashed #ccc;
    border-radius: 5px;
    background-color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    transition: all 0.2s ease;
}

.post-image-uploader .file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.post-image-uploader .upload-text {
    color: #777;
    font-weight: bold;
    pointer-events: none;
    z-index: 1;
}

.post-image-uploader .preview-image {
    display: none;
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
    z-index: 1;
}

.post-image-uploader.drag-active {
    border-color: #2ecc71;
    background-color: #eafaf1;
}

.post-image-uploader:hover {
    border-color: #999;
}

/* =========================================
   RESPONSIVE
   ========================================= */

#numeroGiornate {
    min-width: 60px;
    text-align: center;
}

@media (max-width: 420px) {
    .auth-container-content {
        padding: 1.5rem;
        width: 95%;
    }
}

/* =========================================
   MODAL ACCESSO (dimensioni ristrette)
   ========================================= */

#modalAccesso .modal-dialog {
    max-width: 500px;
    width: 100%;
}

#modalAccesso .modal-body {
    padding: 1.5rem;
}

#modalAccesso .row {
    --bs-gutter-x: 0.75rem;
}

/* Tutti i campi stessa altezza */
#modalAccesso .form-control,
#modalAccesso .form-select {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    height: calc(1.5em + 0.75rem + 2px) !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

#modalAccesso .modal-body.tab-content {
    height: auto !important;
    min-height: unset !important;
}

/* Input group occhio password */
#modalAccesso .input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
}

#modalAccesso .input-group .form-control {
    border-right: 0 !important;
    border-radius: 4px 0 0 4px !important;
}

#modalAccesso .input-group .btn {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    height: calc(1.5em + 0.75rem + 2px) !important;
    line-height: 1.5 !important;
    border-left: 0 !important;
    border-radius: 0 4px 4px 0 !important;
    border-width: 1px !important;
    border-color: rgb(50, 50, 50) !important;
    box-sizing: border-box !important;
    z-index: 0;
}

@media (max-width: 450px) {
    #modalAccesso .modal-dialog {
        margin: 0.5rem auto;
        max-width: 95vw;
    }
}

#modalAccesso #btnIscrivi,
#modalAccesso #btnAccedi {
    padding: 0.5rem 2.5rem;
    font-size: 1rem;
}

#modalAccesso .modal-content {
    border-radius: 12px;
    overflow: hidden;
}

.modal-backdrop {
    backdrop-filter: blur(20px);
    background-color: rgba(0, 0, 0, 0.5);
}

#modalAccesso #regDataNascita.is-valid {
    background-position: right 0.75rem center !important;
    padding-right: 3rem !important;
}
