:root {
    --griffus-pink: #e91e63;
    --griffus-pink-dark: #c2185b;
    --griffus-text-dark: #212121;
    --griffus-text-gray: #757575;
    --griffus-bg-light: #fafafa;
    --griffus-border-subtle: #f8bbd0;
    --input-border: #e0e0e0;
    --focus-shadow: rgba(233, 30, 99, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Verdana, sans-serif;
}

body {
    background-color: var(--griffus-bg-light);
    display: flex;
    justify-content: center;
    padding: 30px 20px;
    color: var(--griffus-text-dark);
}

/* Estilos específicos para a Home */
body.home-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: 0;
    margin: 0;
    background-color: #ffffff;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.03) 1.5px, transparent 1.5px);
    background-size: 35px 35px;
}

.main-container {
    background-color: #ffffff;
    width: 100%;
    max-width: 1300px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
}

.header-strip {
    background-color: var(--griffus-pink);
    color: #ffffff;
    padding: 25px 20px;
    text-align: center;
    border-bottom: 4px solid var(--griffus-pink-dark);
}

.logo {
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.content-body {
    padding: 20px;
}

@media (max-width: 768px) {
    .content-body {
        padding: 20px;
    }
}

fieldset {
    border: 1px solid var(--griffus-border-subtle);
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

legend {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--griffus-pink);
    padding: 0 15px;
    background-color: #fff;
    border-radius: 4px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.full-width {
    grid-column: span 3;
}

.small {
    grid-column: span 1;
}

@media (max-width: 768px) {
    fieldset {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 15px;
    }

    .full-width,
    .small {
        grid-column: span 1;
    }

    .main-container {
        padding: 20px;
    }
}

label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--griffus-text-gray);
    font-weight: 500;
}

input,
select {
    padding: 12px 15px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--griffus-text-dark);
    outline: none;
    transition: all 0.3s ease;
    background-color: #fcfcfc;
}

input:focus,
select:focus {
    border-color: var(--griffus-pink);
    box-shadow: 0 0 0 4px var(--focus-shadow);
    background-color: #fff;
}

input::placeholder {
    color: #bdbdbd;
}

.button-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

button {
    padding: 14px 40px;
    background-color: var(--griffus-pink);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

button:hover {
    background-color: var(--griffus-pink-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

button:active {
    transform: translateY(1px);
}

/* Login Styles */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

/* File Upload Styles */
input[type="file"] {
    display: none;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--griffus-text-dark);
    max-width: 100%;
    box-sizing: border-box;
}

.file-upload-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23757575"><path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.file-upload-label:hover {
    background-color: #e0e0e0;
    border-color: #c0c0c0;
}

input[type="file"]:focus+.file-upload-label {
    border-color: var(--griffus-pink);
    box-shadow: 0 0 0 2px var(--focus-shadow);
}

.file-name-display {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--griffus-text-gray);
    word-break: break-all;
}

/* Badges de limite (aquela etiqueta cinza ao lado do nome) */
.badge-limit {
    font-size: 0.75rem;
    background-color: #eee;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: normal;
}

/* Container do upload */
.upload-wrapper {
    position: relative;
    width: 100%;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background-color: #fafafa;
    border: 2px dashed #e0e0e0;
    /* Borda tracejada moderna */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-label:hover {
    background-color: #f0f0f0;
    border-color: var(--griffus-pink);
}

/* Feedback de Status (O texto que aparece embaixo) */
.file-status {
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
    /* Evita pulo de layout */
    font-weight: 500;
}

.file-status.success {
    color: #2e7d32;
    /* Verde */
}

.file-status.error {
    color: #c62828;
    /* Vermelho */
}

/* Ícones de estado */
.file-status.success::before {
    content: '✔ ';
}

.file-status.error::before {
    content: '✖ ';
}

/* Destaque para documentos obrigatórios não anexados */
.missing-doc {
    border-color: #e53935 !important;
    background-color: #ffebee !important;
    animation: shakeMissing 0.5s ease;
}

@keyframes shakeMissing {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(3px);
    }
}

/* =====================================================
   MODAL LGPD
   ===================================================== */

.modal-lgpd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-lgpd-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUpModal 0.25s ease;
}

@keyframes slideUpModal {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-lgpd-header {
    background: linear-gradient(135deg, var(--griffus-pink), var(--griffus-pink-dark));
    padding: 22px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-lgpd-icon {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.modal-lgpd-header h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.modal-lgpd-body {
    padding: 24px 28px 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-lgpd-body p {
    font-size: 0.92rem;
    color: var(--griffus-text-dark);
    line-height: 1.65;
    margin: 0;
}

.modal-lgpd-body a {
    color: var(--griffus-pink);
    text-decoration: none;
    font-weight: 500;
}

.modal-lgpd-body a:hover {
    text-decoration: underline;
}

.modal-lgpd-check-row {
    padding: 18px 28px 14px;
    border-top: 1px solid #f5f5f5;
    margin-top: 10px;
}

.modal-lgpd-check-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--griffus-text-dark);
    font-weight: 500;
    line-height: 1.5;
    user-select: none;
    margin-bottom: 0;
}

.modal-lgpd-check-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: var(--griffus-pink);
    cursor: pointer;
    padding: 0;
    border: none;
    box-shadow: none;
}

.modal-lgpd-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 28px 24px;
}

.btn-lgpd-cancelar {
    padding: 11px 22px;
    background: #fff;
    color: var(--griffus-text-gray);
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-lgpd-cancelar:hover {
    background: #f5f5f5;
    border-color: #bdbdbd;
    color: var(--griffus-text-dark);
    transform: none;
    box-shadow: none;
}

.btn-lgpd-confirmar {
    padding: 11px 26px;
    background: var(--griffus-pink);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(233, 30, 99, 0.35);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s;
    font-family: inherit;
}

.btn-lgpd-confirmar:hover:not(:disabled) {
    background: var(--griffus-pink-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(233, 30, 99, 0.4);
}

.btn-lgpd-confirmar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 480px) {
    .modal-lgpd-header {
        padding: 18px 20px;
    }

    .modal-lgpd-body {
        padding: 18px 20px 6px;
    }

    .modal-lgpd-check-row {
        padding: 14px 20px 10px;
    }

    .modal-lgpd-footer {
        flex-direction: column-reverse;
        padding: 14px 20px 20px;
    }

    .btn-lgpd-cancelar,
    .btn-lgpd-confirmar {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   RESPONSIVIDADE — Telas pequenas (≤480px)
   ===================================================== */

@media (max-width: 480px) {
    body {
        padding: 14px 8px;
    }

    .header-strip {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 18px 12px;
    }

    .logo {
        max-width: 160px;
    }

    .content-body {
        padding: 14px 10px;
    }

    fieldset {
        grid-template-columns: 1fr;
        padding: 14px 10px;
        gap: 12px;
        margin-bottom: 20px;
    }

    .full-width,
    .small {
        grid-column: span 1;
    }

    label {
        font-size: 0.85rem;
        margin-bottom: 5px;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    input,
    select {
        padding: 10px 12px;
        font-size: 0.92rem;
        min-width: 0;
    }

    .button-container {
        justify-content: center;
    }

    button {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .badge-limit {
        font-size: 0.68rem;
        padding: 1px 5px;
        margin-left: 4px;
        display: inline-block;
    }

    .file-upload-label {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .upload-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .header-strip__titles h2 {
        font-size: 1rem;
        text-align: center;
    }

    .btn-trocar-tipo {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* =====================================================
   RESPONSIVIDADE — Telas muito pequenas (Z-Folder, ≤344px)
   ===================================================== */

@media (max-width: 344px) {
    body {
        padding: 6px 2px;
    }

    .main-container {
        border-radius: 6px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

    .header-strip {
        padding: 12px 8px;
        gap: 6px;
    }

    .logo {
        max-width: 110px;
    }

    .content-body {
        padding: 8px 5px;
    }

    fieldset {
        padding: 8px 6px;
        gap: 8px;
        margin-bottom: 12px;
        grid-template-columns: 1fr;
    }

    legend {
        font-size: 0.88rem;
        padding: 0 6px;
    }

    label {
        font-size: 0.78rem;
        margin-bottom: 4px;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }

    input,
    select {
        padding: 9px 8px;
        font-size: 0.85rem;
        min-width: 0;
    }

    .badge-limit {
        font-size: 0.6rem;
        padding: 1px 3px;
        margin-left: 3px;
    }

    .file-upload-label {
        padding: 8px 6px;
        font-size: 0.78rem;
    }

    .file-upload-icon {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }

    button {
        padding: 11px 16px;
        font-size: 0.88rem;
    }

    .header-strip__titles h2 {
        font-size: 0.85rem;
        text-align: center;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .btn-trocar-tipo {
        font-size: 0.68rem;
        padding: 0.3rem 0.6rem;
    }

    /* Modal LGPD — telas muito pequenas */
    .modal-lgpd-overlay {
        padding: 10px 4px;
    }

    .modal-lgpd-box {
        border-radius: 10px;
    }

    .modal-lgpd-header {
        padding: 12px 10px;
        gap: 8px;
    }

    .modal-lgpd-header h3 {
        font-size: 0.88rem;
    }

    .modal-lgpd-icon {
        font-size: 1.3rem;
    }

    .modal-lgpd-body {
        padding: 10px 10px 4px;
    }

    .modal-lgpd-body p {
        font-size: 0.78rem;
        line-height: 1.45;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .modal-lgpd-check-row {
        padding: 8px 10px 6px;
    }

    .modal-lgpd-check-label {
        font-size: 0.78rem;
        gap: 6px;
    }

    .modal-lgpd-check-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .modal-lgpd-footer {
        padding: 8px 10px 14px;
        gap: 6px;
        flex-direction: column-reverse;
    }

    .btn-lgpd-cancelar,
    .btn-lgpd-confirmar {
        font-size: 0.78rem;
        padding: 9px 14px;
        width: 100%;
        justify-content: center;
    }

    /* Seleção de tipo de contrato — telas muito estreitas */
    .selecao-header {
        padding: 16px 10px;
    }

    .selecao-logo {
        width: 70px;
    }

    .selecao-titulo {
        font-size: 1.15rem;
    }

    .selecao-subtitulo {
        font-size: 0.78rem;
    }

    .selecao-body {
        padding: 12px 8px;
        gap: 8px;
    }

    .selecao-btn {
        padding: 10px 10px;
    }

    .selecao-btn__icon {
        font-size: 1.1rem;
        width: 28px;
        height: 28px;
        margin-right: 8px;
    }

    .selecao-btn__text strong {
        font-size: 0.85rem;
    }

    .selecao-btn__text span {
        font-size: 0.72rem;
    }

    .selecao-footer {
        font-size: 0.7rem;
        padding: 12px 8px;
    }
}