:root {
    --idee-primary: #32b5f4;
    --idee-primary-dark: #168fce;
    --idee-primary-soft: #e3f5ff;
    --idee-bg: #eaf6fc;
    --idee-bg-soft: #f4f8fc;
    --idee-card: #ffffff;
    --idee-card-soft: #f8fcff;
    --idee-border: #b8c7d9;
    --idee-text: #16263d;
    --idee-muted: #52657a;
    --idee-shadow: 0 14px 36px rgba(30, 73, 108, .11);
}

* {
    box-sizing: border-box;
}

html body {
    display: block;
    min-height: 100vh;
    margin: 0;
    padding: 28px 20px 48px;
    color: var(--idee-muted);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    background:
        radial-gradient(circle at 8% 5%, rgba(50, 181, 244, .15), transparent 28rem),
        linear-gradient(135deg, var(--idee-bg) 0%, var(--idee-bg-soft) 56%, #edf5fb 100%);
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    opacity: .08;
    background: transparent;
    pointer-events: none;
}

body > .container.py-4 {
    width: min(1120px, 100%);
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 !important;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* Encabezado del módulo */
body > .container > .text-center.mb-4 {
    position: relative;
    min-height: 142px;
    margin-bottom: 24px !important;
    padding: 29px 34px 25px 126px;
    overflow: hidden;
    text-align: left !important;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(184, 199, 217, .72);
    border-radius: 22px;
    box-shadow: var(--idee-shadow);
    backdrop-filter: blur(8px);
}

body > .container > .text-center.mb-4::before {
    content: "\F4DA";
    position: absolute;
    top: 50%;
    left: 34px;
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    color: #087fb9;
    font-family: "bootstrap-icons";
    font-size: 34px;
    background: linear-gradient(145deg, #dff4ff, #c9ecff);
    border: 1px solid #abe0fa;
    border-radius: 18px;
    box-shadow: 0 9px 20px rgba(50, 181, 244, .18);
    transform: translateY(-50%);
}

body > .container > .text-center.mb-4::after {
    content: "";
    position: absolute;
    right: -50px;
    bottom: -80px;
    width: 230px;
    height: 230px;
    background: radial-gradient(circle, rgba(50, 181, 244, .15), transparent 68%);
    pointer-events: none;
}

body > .container > .text-center h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    color: var(--idee-text);
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 650 !important;
    line-height: 1.12;
    letter-spacing: -.035em;
    text-align: left;
}

body > .container > .text-center .text-muted {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    color: var(--idee-muted) !important;
    font-size: 1rem;
    line-height: 1.5;
}

body > .container > .text-center a {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    color: #087fb9;
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s ease;
}

body > .container > .text-center a:hover {
    color: var(--idee-primary-dark);
    text-decoration: underline;
}

/* Tarjetas del formulario */
#clienteForm > .card {
    overflow: hidden;
    background: linear-gradient(145deg, var(--idee-card) 0%, var(--idee-card-soft) 100%);
    border: 1px solid rgba(184, 199, 217, .72) !important;
    border-radius: 20px !important;
    box-shadow: var(--idee-shadow) !important;
}

#clienteForm > .card .card-body {
    padding: 27px !important;
}

#clienteForm .card h4 {
    position: relative;
    margin-bottom: 24px !important;
    padding-bottom: 15px;
    color: var(--idee-text);
    font-size: 1.08rem;
    font-weight: 600 !important;
    line-height: 1.35;
    border-bottom: 1px solid #dce7ef;
}

#clienteForm .card h4::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 44px;
    height: 3px;
    background: var(--idee-primary);
    border-radius: 4px;
}

/* Etiquetas y controles */
#clienteForm .form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--idee-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .01em;
}

#clienteForm .form-control,
#clienteForm .form-select {
    min-height: 49px;
    padding: 11px 14px;
    color: var(--idee-text);
    font-family: inherit;
    font-size: 15px;
    background-color: #fbfdff !important;
    border: 1px solid var(--idee-border) !important;
    border-radius: 11px !important;
    outline: none;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

#clienteForm .form-control:hover,
#clienteForm .form-select:hover {
    border-color: #8db4d0 !important;
}

#clienteForm .form-control:focus,
#clienteForm .form-select:focus {
    background-color: #fff !important;
    border-color: var(--idee-primary) !important;
    box-shadow: 0 0 0 4px rgba(50, 181, 244, .14) !important;
}

#clienteForm .form-control[readonly] {
    color: #5b6d7f;
    background: #eef4f8 !important;
}

#clienteForm textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Botones */
.btn {
    font-weight: 600;
    border-radius: 11px !important;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease,
        box-shadow .2s ease, transform .2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:focus-visible {
    outline: 3px solid rgba(50, 181, 244, .3);
    outline-offset: 2px;
}

#clienteForm .btn-primary,
.modal .btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--idee-primary), var(--idee-primary-dark));
    border-color: var(--idee-primary-dark);
    box-shadow: 0 8px 18px rgba(22, 143, 206, .2);
}

#clienteForm .btn-dark,
.modal .btn-dark {
    color: #fff;
    background: linear-gradient(135deg, #344a62, #1f3044);
    border-color: #263a50;
}

#clienteForm .btn-success {
    min-height: 54px;
    padding: 13px 38px !important;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--idee-primary), var(--idee-primary-dark));
    border: 0;
    border-radius: 13px !important;
    box-shadow: 0 10px 22px rgba(22, 143, 206, .25) !important;
}

#clienteForm .btn-success:hover {
    filter: brightness(.97);
    box-shadow: 0 13px 27px rgba(22, 143, 206, .32) !important;
}

#clienteForm .text-center.mb-5 {
    margin-top: 27px;
}

#estadoFoto,
#estadoMapa {
    display: inline-flex;
    margin-top: 17px;
    margin-right: 16px;
    padding: 8px 11px;
    background: #fff6f7;
    border: 1px solid #f1c8cd;
    border-radius: 9px;
}

/* Modales, cámara y mapa */
.modal .modal-content {
    overflow: hidden;
    color: var(--idee-text);
    background: var(--idee-card-soft);
    border: 1px solid var(--idee-border) !important;
    border-radius: 18px !important;
    box-shadow: 0 22px 55px rgba(22, 38, 61, .2);
}

.modal .modal-header {
    min-height: 67px;
    padding: 17px 22px;
    background: #fff;
    border-bottom: 1px solid #dce6ee;
}

.modal .modal-title {
    color: var(--idee-text);
    font-weight: 600;
}

#modalFoto .modal-body {
    height: auto;
    padding: 24px !important;
}

#modalFoto .camera-card {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    overflow: hidden;
    text-align: center;
    background: #eff6fa;
    border: 1px solid #d4e0ea;
    border-radius: 18px;
    box-shadow: none;
}

#modalFoto video {
    display: block;
    width: 100%;
    max-height: 62vh;
    object-fit: cover;
    background: #172536;
    border: 1px solid #c5d3df;
    border-radius: 14px;
}

#modalFoto .controles {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 16px;
    background: transparent;
}

#modalFoto .controles .btn {
    display: inline-grid;
    width: 54px;
    height: 54px;
    padding: 0;
    place-items: center;
    font-size: 20px;
}

#modalMapa .modal-content {
    border: 0 !important;
    border-radius: 0 !important;
}

#modalMapa .modal-body {
    height: calc(100vh - 67px);
    padding: 0 !important;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
}

/* Capa de carga */
.loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    background: rgba(17, 38, 59, .58);
    backdrop-filter: blur(5px);
}

.loading.oculto {
    display: none;
}

.loading .spinner {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    border: 4px solid rgba(255, 255, 255, .32);
    border-top-color: var(--idee-primary);
    border-radius: 50%;
    animation: idee-spin .8s linear infinite;
}

@keyframes idee-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    html body {
        padding: 14px 11px 30px;
    }

    body > .container > .text-center.mb-4 {
        min-height: auto;
        padding: 24px 18px 22px 84px;
        border-radius: 17px;
    }

    body > .container > .text-center.mb-4::before {
        left: 18px;
        width: 51px;
        height: 51px;
        font-size: 26px;
        border-radius: 14px;
    }

    body > .container > .text-center .text-muted {
        font-size: .91rem;
    }

    #clienteForm > .card {
        border-radius: 17px !important;
    }

    #clienteForm > .card .card-body {
        padding: 20px !important;
    }

    #clienteForm .d-flex.gap-3 .btn {
        width: 100%;
        margin: 0;
    }

    #estadoFoto,
    #estadoMapa {
        display: flex;
        margin-right: 0;
    }

    #clienteForm .btn-success {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
