/* Formulário de Juízes - Estilos */

:root {
    --primary-color: #5D5FEF;
    --secondary-color: #764ba2;
    --accent-color: #FF6B6B;
    --text-dark: #2C3E50;
    --text-light: #6C757D;
    --bg-light: #F8F9FA;
    --border-color: #E9ECEF;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.form-wrapper {
    padding: 1.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.form-header-modern {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-header-modern h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    /* text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); */
    /* Gradiente para tema claro */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Branco para tema escuro */
[data-theme="dark"] .form-header-modern h1 {
    background: none;
    -webkit-text-fill-color: white;
    color: white;
}

.form-header-modern .subtitle {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 400;
    color: #0A5F8E;
}

[data-theme="dark"] .form-header-modern .subtitle {
    color: white;
}

.form-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.form-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-light);
}

.section-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-right: 1rem;
    box-shadow: 0 4px 12px rgba(93, 95, 239, 0.3);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0.25rem 0 0 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.form-group-modern {
    margin-bottom: 0;
}

.form-group-modern.full-width {
    grid-column: 1 / -1;
}

.form-label-modern {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label-modern .required {
    color: var(--accent-color);
    margin-left: 4px;
}

.form-control-modern,
select.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-light);
    color: var(--text-dark);
}

.form-control-modern:focus,
select.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(93, 95, 239, 0.1);
}

/* Gradiente no hover */
.form-control-modern:hover,
select.form-control:hover {
    background: white;
    border-image: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) 1;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.radio-group-modern,
.checkbox-group-modern {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    padding: 0.625rem 1rem;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-item:hover,
.checkbox-item:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-sm);
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-item label,
.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
    font-size: 0.95rem;
}

.amatra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.75rem;
}

.amatra-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    padding: 0.6rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-dark);
}

.amatra-item:hover {
    border-color: var(--primary-color);
    background: white;
}

.amatra-item input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

.info-box {
    background: rgba(93, 95, 239, 0.08);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 10px;
    margin: 1.25rem 0;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 0.9rem;
}

.info-box strong {
    color: var(--primary-color);
}

.btn-submit-modern {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 6px 20px rgba(93, 95, 239, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-submit-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(93, 95, 239, 0.5);
}

.btn-submit-modern:active {
    transform: translateY(-1px);
}

.btn-submit-modern i {
    font-size: 1.25rem;
}

.alert-modern {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    border-left: 4px solid;
    font-size: 0.9rem;
}

.alert-danger-modern {
    background: #FFF5F5;
    border-color: var(--accent-color);
    color: #C53030;
}

.loading-spinner {
    display: none;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.cep-loading {
    position: relative;
}

.cep-loading::after {
    content: "";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: none;
}

.cep-loading.loading::after {
    display: block;
}

.btn-clear-signature {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear-signature:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-clear-signature i {
    font-size: 1rem;
}

/* Signature Options Styles */
.signature-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-signature-option {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.btn-signature-option:hover {
    border-color: var(--primary-color);
    background: rgba(93, 95, 239, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-signature-option i {
    font-size: 2rem;
    color: var(--primary-color);
}

.btn-signature-option span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.btn-signature-option small {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Signature Preview */
.signature-preview-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
}

#signature-preview {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    background: white;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.btn-change-signature {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-change-signature:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(93, 95, 239, 0.3);
}

.btn-apply-signature {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.btn-apply-signature:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(93, 95, 239, 0.4);
}

/* Signature Modal */
.signature-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.signature-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.signature-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--bg-light);
}

.signature-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.signature-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.signature-modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.signature-modal-body {
    padding: 2rem;
}

.signature-modal-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    text-align: center;
}

.signature-styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.signature-style-option {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signature-style-option:hover {
    border-color: var(--primary-color);
    background: rgba(93, 95, 239, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.signature-style-option.selected {
    border-color: var(--primary-color);
    background: rgba(93, 95, 239, 0.1);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.2);
}

.signature-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--bg-light);
    display: flex;
    justify-content: flex-end;
}

.btn-modal-cancel {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-modal-cancel:hover {
    border-color: var(--text-dark);
    background: var(--bg-light);
}

@media (max-width: 768px) {
    .form-card {
        padding: 1.25rem;
    }

    .form-grid,
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-header-modern h1 {
        font-size: 1.5rem;
    }

    .amatra-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .btn-submit-modern {
        width: 100%;
        max-width: 100%;
    }

    .signature-options {
        grid-template-columns: 1fr;
    }

    .signature-styles-grid {
        grid-template-columns: 1fr;
    }

    .signature-modal-content {
        width: 95%;
        max-height: 95vh;
    }
}