/* GTG Registrazione - Form Frontend Styles */

/* Forma Giuridica Selector */
.gtg-forma-giuridica-wrapper {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.gtg-forma-giuridica-wrapper label {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    display: block;
}

.gtg-forma-giuridica-wrapper select {
    font-size: 15px;
    padding: 10px 15px;
    height: auto;
}

.gtg-forma-description {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border-left: 3px solid #007bff;
    font-size: 13px;
    color: #6c757d;
}

/* Field Groups */
.gtg-field-group {
    transition: all 0.3s ease;
}

.gtg-field-group.hidden {
    display: none !important;
}

.gtg-field-group.fade-in {
    animation: gtgFadeIn 0.3s ease;
}

@keyframes gtgFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Required Field Indicator */
.gtg-required:after {
    content: " *";
    color: #dc3545;
}

/* Custom Fields Sections */
.gtg-section-persona-fisica,
.gtg-section-azienda,
.gtg-section-ente {
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
}

.gtg-section-persona-fisica {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.gtg-section-azienda {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
}

.gtg-section-ente {
    background: #fff3e0;
    border: 1px solid #ffe0b2;
}

/* Field Validation States */
.gtg-field-valid {
    border-color: #28a745 !important;
}

.gtg-field-invalid {
    border-color: #dc3545 !important;
}

.gtg-validation-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

.gtg-validation-icon.valid {
    color: #28a745;
}

.gtg-validation-icon.invalid {
    color: #dc3545;
}

/* Input Groups with Validation */
.gtg-input-group {
    position: relative;
}

.gtg-input-group input {
    padding-right: 35px;
}

/* Help Text */
.gtg-help-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .gtg-forma-giuridica-wrapper {
        padding: 10px;
    }

    .gtg-forma-giuridica-wrapper select {
        font-size: 14px;
    }
}

/* Custom Field Overrides */
.register-company-group,
.register-vat-group,
.register-cf-group,
.register-pec-group,
.register-sdi-group,
.register-rea-group {
    transition: all 0.3s ease;
}

/* SDI/PEC Alternative Notice */
.gtg-sdi-pec-notice {
    background: #fff8e1;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
    color: #856404;
    border: 1px solid #ffc107;
}

.gtg-sdi-pec-notice i {
    margin-right: 5px;
}

/* Loading State */
.gtg-loading {
    position: relative;
    pointer-events: none;
}

.gtg-loading:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="35" stroke="%23007bff" stroke-width="8" fill="none" stroke-dasharray="164.93361431346415 56.97787143782138"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"></animateTransform></circle></svg>') center no-repeat;
    background-size: 40px;
    border-radius: 8px;
}

/* Checkbox Styling */
.gtg-checkbox-group {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.gtg-checkbox-group label {
    font-weight: normal;
    cursor: pointer;
}

/* Form Steps Indicator (for multi-step if needed) */
.gtg-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.gtg-step {
    flex: 1;
    text-align: center;
    padding: 10px;
    position: relative;
}

.gtg-step:not(:last-child):after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 50%;
    height: 2px;
    background: #dee2e6;
}

.gtg-step.active .gtg-step-number {
    background: #007bff;
    color: #fff;
}

.gtg-step.completed .gtg-step-number {
    background: #28a745;
    color: #fff;
}

.gtg-step-number {
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: #dee2e6;
    display: inline-block;
    margin-bottom: 5px;
}

.gtg-step-label {
    font-size: 12px;
    color: #6c757d;
}

/* Tooltip Icon Styles */
.gtg-tooltip-icon {
    margin-left: 5px;
    color: #5b92d6;
    cursor: help;
    font-size: 14px;
    transition: color 0.2s ease;
}

.gtg-tooltip-icon:hover {
    color: #3a7bc8;
}

/* Bootstrap Tooltip Customization */
.tooltip {
    font-size: 13px;
}

.tooltip-inner {
    max-width: 380px;
    padding: 12px 15px;
    background-color: #333;
    border-radius: 8px;
    text-align: left;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Tooltip per consensi (privacy, termini) - più larghi */
.gtg-consents-wrapper .tooltip-inner {
    max-width: 420px;
}

.tooltip.bs-tooltip-top .arrow::before,
.tooltip.bs-tooltip-auto[x-placement^="top"] .arrow::before {
    border-top-color: #333;
}

.tooltip.bs-tooltip-bottom .arrow::before,
.tooltip.bs-tooltip-auto[x-placement^="bottom"] .arrow::before {
    border-bottom-color: #333;
}

/* Label with tooltip alignment */
.form-group label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.form-group label .text-danger {
    margin-right: 3px;
}
