/**
 * Trademark Registration Form Styles
 * Version 1.2.0
 * Aligned with Registmark site design: Navy #002C74, Orange #F5710C, Poppins/Montserrat
 */

/* ===== Fix Uncode custom scroll blocking normal scroll on form pages ===== */
html:has(.register-gf-form) {
    overflow: auto !important;
    overflow-y: scroll !important;
}

/* When modal IS open, lock page scroll on both html and body */
html.nice-modal-open {
    overflow: hidden !important;
}

/* ===== Nice Classes Container ===== */
.register-gf-form .nice-classes-container {
    margin: 20px 0;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e8e8e8;
}

.register-gf-form .nice-classes-header {
    margin-bottom: 20px;
}

.register-gf-form .nice-classes-header p {
    font-size: 15px;
    margin-bottom: 12px;
    color: #002C74;
    font-weight: 500;
}

/* ===== Legend ===== */
.register-gf-form .nice-classes-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #F7F7F7;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}

.register-gf-form .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #002C74;
}

.register-gf-form .legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: none;
}

.register-gf-form .legend-color.goods {
    background: linear-gradient(135deg, #F5710C 0%, #F7931E 100%);
}

.register-gf-form .legend-color.services {
    background: linear-gradient(135deg, #002C74 0%, #1A4B9C 100%);
}

/* ===== Classes Grid ===== */
.register-gf-form .nice-classes-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .register-gf-form .nice-classes-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }
}

@media (max-width: 400px) {
    .register-gf-form .nice-classes-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
}

/* ===== Class Item ===== */
.register-gf-form .nice-class-item {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.register-gf-form .nice-class-item.goods {
    border-left: 4px solid #F5710C;
}

.register-gf-form .nice-class-item.services {
    border-left: 4px solid #002C74;
}

.register-gf-form .nice-class-item:hover {
    box-shadow: 0 4px 15px rgba(0, 44, 116, 0.1);
    transform: translateY(-2px);
}

.register-gf-form .nice-class-item.selected {
    background: linear-gradient(135deg, #F5710C 0%, #F7931E 100%);
    border-color: #F5710C;
}

/* ===== Compact Style (number-only boxes) ===== */
.register-gf-form .nice-class-item.compact {
    padding: 0;
    border: none;
    cursor: pointer;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Goods: Soft orange tones */
.register-gf-form .nice-class-item.compact.goods {
    background: #FDDCBF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.register-gf-form .nice-class-item.compact.goods:hover {
    background: #F5C28C;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Services: Soft blue tones */
.register-gf-form .nice-class-item.compact.services {
    background: #C5D5ED;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.register-gf-form .nice-class-item.compact.services:hover {
    background: #A3BFDF;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Remove the left border pseudo-element for compact */
.register-gf-form .nice-class-item.compact.goods::before,
.register-gf-form .nice-class-item.compact.services::before {
    display: none;
}

/* Selected: Solid confirmation color */
.register-gf-form .nice-class-item.compact.selected {
    background: #F5710C !important;
    box-shadow: 0 2px 8px rgba(245, 113, 12, 0.3) !important;
    transform: scale(1.03);
}

/* Hidden checkbox - aggressive hiding for theme overrides */
.register-gf-form .class-checkbox-hidden,
.register-gf-form input.class-checkbox-hidden,
.register-gf-form .nice-class-item input[type="checkbox"].class-checkbox-hidden {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.register-gf-form .class-number-display {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    line-height: 1;
    font-family: 'Montserrat', 'Poppins', sans-serif;
}

/* White text when selected */
.register-gf-form .nice-class-item.compact.selected .class-number-display {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ===== Old styles for compatibility ===== */
.register-gf-form .nice-class-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.register-gf-form .nice-class-item input[type="checkbox"]:not(.class-checkbox-hidden) {
    margin-top: 2px;
    flex-shrink: 0;
}

.register-gf-form .class-number {
    font-weight: bold;
    font-size: 18px;
    color: #002C74;
    min-width: 30px;
}

.register-gf-form .class-heading {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    flex: 1;
}

.register-gf-form .view-terms-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 5px 10px;
    font-size: 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    justify-content: center;
}

.register-gf-form .view-terms-btn:hover {
    background: #e0e0e0;
}

/* ===== Selected Classes (hidden) ===== */
.register-gf-form .nice-classes-selected {
    display: none;
}

/* ===== Selected Terms Preview ===== */
.register-gf-form .selected-terms-preview {
    background: #FAFAFA;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    margin-top: 16px;
}

.register-gf-form .selection-header {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.register-gf-form .selection-header p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
}

.register-gf-form .selected-terms-preview .terms-count,
.register-gf-form .selected-terms-preview .classes-count {
    display: inline-block;
    background: #002C74;
    color: white;
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    font-size: 11px;
}

.register-gf-form .selected-terms-items {
    margin-top: 6px;
}

.register-gf-form .terms-class-group {
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px 10px;
}

.register-gf-form .terms-class-group:last-child {
    margin-bottom: 0;
}

.register-gf-form .terms-class-header {
    font-weight: 600;
    color: #002C74;
    margin-bottom: 6px;
    font-size: 11px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.register-gf-form .terms-class-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.register-gf-form .selected-term-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: #444;
    transition: all 0.15s ease;
}

.register-gf-form .selected-term-badge:hover {
    background: #eee;
}

.register-gf-form .selected-term-badge .remove-term,
.selected-term-badge .remove-term,
.remove-term {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    color: #aaa !important;
    font-size: 14px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 2px !important;
    margin: 0 0 0 4px !important;
    font-weight: normal !important;
    border-radius: 0 !important;
    display: inline !important;
    min-width: auto !important;
    min-height: auto !important;
    max-width: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: color 0.15s !important;
}

.register-gf-form .selected-term-badge .remove-term:hover,
.selected-term-badge .remove-term:hover,
.remove-term:hover {
    color: #d32f2f !important;
    background: transparent !important;
    background-color: transparent !important;
}

.register-gf-form .selected-count {
    display: inline-block;
    background: #002C74;
    color: white;
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    font-size: 11px;
}

.register-gf-form .selected-classes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.register-gf-form .selected-class-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
}

.register-gf-form .selected-class-badge .class-num {
    font-weight: 600;
    color: #002C74;
}

.register-gf-form .selected-class-badge .class-title {
    color: #666;
}

.register-gf-form .remove-class {
    background: none;
    border: none;
    color: #999;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 3px;
}

.register-gf-form .remove-class:hover {
    color: #d32f2f;
}

.register-gf-form .no-selection {
    color: #999;
    font-style: italic;
    margin: 0;
}

/* ===== Modal ===== */
.nice-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 20, 50, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.nice-modal-content {
    background-color: #fff;
    margin: 10px auto 20px;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 44, 116, 0.25);
    animation: modalSlideIn 0.25s ease-out;
    position: relative;
}

/* Account for WP admin bar (32px) + sticky site header (~105px) */
.admin-bar .nice-modal-content {
    margin-top: 165px;
    max-height: calc(100vh - 185px);
}

/* Non-admin view (just site header ~105px) */
body:not(.admin-bar) .nice-modal-content {
    margin-top: 130px;
    max-height: calc(100vh - 150px);
}

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

.nice-modal-header {
    padding: 18px 24px;
    background: linear-gradient(135deg, #002C74 0%, #1A4B9C 100%);
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.nice-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fff !important;
    font-weight: 600;
    font-family: 'Montserrat', 'Poppins', sans-serif;
}

.nice-modal-header .modal-class-number {
    color: #F7931E;
}

.nice-modal-close {
    font-size: 24px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    width: auto;
    height: auto;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.nice-modal-close:hover,
.nice-modal-close:focus {
    color: white;
    background: rgba(255, 255, 255, 0.25);
}

.nice-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}

/* ===== Search Input ===== */
.nice-modal .terms-search {
    margin-bottom: 16px;
}

.nice-modal .terms-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    background: #F7F7F7;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

.nice-modal .terms-search-input:focus {
    outline: none;
    border-color: #F5710C;
    background: white;
    box-shadow: 0 0 0 3px rgba(245, 113, 12, 0.12);
}

.nice-modal .terms-list-container {
    max-height: 400px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: white;
}

/* Scrollbar styling */
.nice-modal .terms-list-container::-webkit-scrollbar {
    width: 6px;
}

.nice-modal .terms-list-container::-webkit-scrollbar-track {
    background: #F7F7F7;
    border-radius: 3px;
}

.nice-modal .terms-list-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.nice-modal .terms-list-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.nice-modal .terms-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nice-modal .terms-list li {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.nice-modal .terms-list li:hover {
    background: #FFFAF5;
}

.nice-modal .terms-list li.loading,
.nice-modal .terms-list li.error,
.nice-modal .terms-list li.no-terms {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 24px;
}

.nice-modal .terms-list li.error {
    color: #d32f2f;
}

/* ===== Modal Footer ===== */
.nice-modal-footer {
    padding: 14px 24px;
    background: #F7F7F7;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 16px 16px;
}

.nice-modal-footer .button.button-primary,
.nice-modal-footer .nice-modal-close.button {
    background: #F5710C;
    border-color: #F5710C;
    color: white;
    border-radius: 50px 50px 50px 0px;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.nice-modal-footer .button.button-primary:hover,
.nice-modal-footer .nice-modal-close.button:hover {
    background: #E0650A;
    border-color: #E0650A;
}

.selected-terms-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #002C74;
}

.selected-terms-count {
    display: inline-block;
    background: #002C74;
    color: white;
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    font-size: 11px;
}

body.nice-modal-open {
    overflow: hidden !important;
}

/* Force modal above sticky headers */
body.nice-modal-open .menu-wrapper,
body.nice-modal-open .header-wrapper,
body.nice-modal-open header,
body.nice-modal-open .menu-sticky,
body.nice-modal-open #masthead,
body.nice-modal-open .top-border,
body.nice-modal-open .right-border,
body.nice-modal-open .bottom-border,
body.nice-modal-open .left-border,
body.nice-modal-open .body-border-shadow,
body.nice-modal-open #wpadminbar,
body.nice-modal-open .menu-container {
    z-index: 1 !important;
}

/* ===== Hide Product field visually (keep in DOM for GF/Stripe) ===== */
#field_1_27,
.register-gf-form .gfield_price,
.register-gf-form .gfield--type-product,
.register-gf-form .gfield--input-type-singleproduct {
    position: absolute !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    height: 1px !important;
    width: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
}

/* ===== Quotation Preview ===== */
/* The wrapper li must span the full GF grid */
.register-gf-form .quotation-preview-wrapper,
li.quotation-preview-wrapper,
.gform_fields .quotation-preview-wrapper {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.register-gf-form .quotation-preview,
.quotation-preview {
    margin: 30px 0;
    padding: 24px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    float: none !important;
    clear: both !important;
    grid-column: 1 / -1 !important;
    background: #FFF8F2;
    border: 1px solid #F5C28C;
    border-radius: 16px;
}

.register-gf-form .quotation-preview h4 {
    margin: 0 0 15px 0;
    color: #002C74;
    font-size: 18px;
    font-family: 'Montserrat', 'Poppins', sans-serif;
}

.register-gf-form .quotation-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.register-gf-form .quotation-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.register-gf-form .quotation-table .amount {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
    color: #002C74;
}

.register-gf-form .quotation-table tr.section-header td {
    background: #F7F7F7;
    font-size: 13px;
    color: #002C74;
    padding: 8px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.register-gf-form .quotation-table tr.subtotal td {
    border-top: 2px solid #e8e8e8;
    padding-top: 15px;
}

.register-gf-form .quotation-table tr.total td {
    background: #FFF3E8;
    color: #F5710C;
    font-size: 18px;
    font-weight: 700;
    border-bottom: none;
}

.register-gf-form .quotation-note {
    margin: 12px 0 0 0;
    font-size: 12px;
    color: #888;
    text-align: center;
}

/* ===== Quotation Breakdown (confirmation) ===== */
.trademark-quotation-breakdown {
    margin: 30px 0;
    padding: 25px;
    background: white;
    border: 2px solid #F5710C;
    border-radius: 16px;
}

.trademark-quotation-breakdown h3 {
    margin: 0 0 20px 0;
    color: #002C74;
    font-size: 22px;
}

.quotation-notes {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ===== Confirmation Page ===== */
.trademark-confirmation {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
}

.trademark-confirmation h2 {
    color: #002C74;
    margin-bottom: 10px;
}

/* ===== Error State ===== */
.register-gf-form .nice-classes-error {
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    color: #b91c1c;
    text-align: center;
}

/* ===== Tree View Styles ===== */
.nice-modal .terms-list.tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nice-modal .terms-list .tree-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nice-modal .terms-list .tree-node {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 8px;
    transition: background 0.15s ease;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.nice-modal .terms-list .tree-node:hover {
    background: #FFFAF5;
}

.nice-modal .terms-list .tree-toggle {
    width: 18px;
    height: 18px;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.nice-modal .terms-list .tree-toggle:hover {
    background: #f0f0f0;
    color: #002C74;
}

.nice-modal .terms-list .tree-spacer {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nice-modal .terms-list .term-checkbox {
    margin: 0 8px;
    cursor: pointer;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #F5710C;
}

.nice-modal .terms-list .tree-text {
    flex: 1;
    font-size: 13px;
    color: #333;
    padding: 0 6px;
    cursor: pointer;
    line-height: 1.4;
}

.nice-modal .terms-list .tree-badge {
    background: #FFF3E8;
    color: #F5710C;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

/* Top-level tree items */
.nice-modal .terms-list ul.tree-list[data-level="0"] > .tree-item > .tree-node {
    font-weight: 600;
    background: #F7F7F7;
    border-bottom: 1px solid #e8e8e8;
    padding: 9px 12px;
}

.nice-modal .terms-list ul.tree-list[data-level="0"] > .tree-item > .tree-node:hover {
    background: #FFFAF5;
}

/* Second-level items */
.nice-modal .terms-list ul.tree-list[data-level="1"] > .tree-item > .tree-node .tree-text {
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .nice-modal-content {
        width: 96%;
        border-radius: 12px;
    }

    .admin-bar .nice-modal-content {
        margin-top: 100px;
        max-height: calc(100vh - 120px);
    }

    body:not(.admin-bar) .nice-modal-content {
        margin-top: 70px;
        max-height: calc(100vh - 90px);
    }

    .nice-modal-header {
        padding: 14px 16px;
        border-radius: 12px 12px 0 0;
    }

    .nice-modal-header h3 {
        font-size: 16px;
    }

    .nice-modal-body {
        padding: 14px 16px;
    }

    .nice-modal-footer {
        padding: 12px 16px;
        border-radius: 0 0 12px 12px;
    }

    .register-gf-form .nice-classes-legend {
        flex-direction: column;
        gap: 8px;
    }

    .register-gf-form .nice-classes-container {
        padding: 16px;
    }

    .register-gf-form .selected-classes-list {
        flex-direction: column;
    }

    .nice-modal .terms-list .tree-node {
        padding: 6px 8px;
    }

    .nice-modal .terms-list .tree-text {
        font-size: 12px;
        padding: 0 4px;
    }

    .register-gf-form .class-number-display {
        font-size: 18px;
    }

    .register-gf-form .nice-class-item.compact {
        border-radius: 4px;
    }
}

/* ===== Form Field Borders (all GF inputs) ===== */
.register-gf-form input[type="text"],
.register-gf-form input[type="email"],
.register-gf-form input[type="tel"],
.register-gf-form input[type="number"],
.register-gf-form input[type="url"],
.register-gf-form input[type="password"],
.register-gf-form select,
.register-gf-form textarea {
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    padding: 7px 14px !important;
    background: #fff !important;
    font-size: 15px !important;
    color: #333 !important;
    transition: border-color 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.register-gf-form input[type="text"]:focus,
.register-gf-form input[type="email"]:focus,
.register-gf-form input[type="tel"]:focus,
.register-gf-form input[type="number"]:focus,
.register-gf-form input[type="url"]:focus,
.register-gf-form input[type="password"]:focus,
.register-gf-form select:focus,
.register-gf-form textarea:focus {
    border-color: #002C74 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 44, 116, 0.1) !important;
}

.register-gf-form select {
    appearance: auto !important;
    -webkit-appearance: auto !important;
}

/* GF field labels */
.register-gf-form .gfield_label {
    font-weight: 600 !important;
    color: #002C74 !important;
    font-size: 14px !important;
    margin-bottom: 6px !important;
}

/* GF checkbox and radio - force native appearance */
.register-gf-form input[type="checkbox"],
.register-gf-form input[type="radio"] {
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    width: 18px !important;
    height: 18px !important;
    opacity: 1 !important;
    position: relative !important;
    visibility: visible !important;
    pointer-events: auto !important;
    margin: 0 8px 0 0 !important;
    cursor: pointer !important;
    accent-color: #002C74 !important;
}

.register-gf-form .gfield_checkbox .gchoice,
.register-gf-form .gfield_radio .gchoice {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

/* GF radio and checkbox label styling */
.register-gf-form .gfield_radio label,
.register-gf-form .gfield_checkbox label {
    font-size: 14px !important;
    color: #333 !important;
    cursor: pointer !important;
}

/* GF description/sub-labels */
.register-gf-form .gfield_description,
.register-gf-form .ginput_container label {
    font-size: 13px !important;
    color: #666 !important;
}

/* GF validation error border */
.register-gf-form .gfield_error input[type="text"],
.register-gf-form .gfield_error input[type="email"],
.register-gf-form .gfield_error input[type="tel"],
.register-gf-form .gfield_error select,
.register-gf-form .gfield_error textarea {
    border-color: #c02b0a !important;
}

/* GF page buttons - shared base */
.register-gf-form .gform_next_button,
.register-gf-form .gform_previous_button,
.register-gf-form .gform_button {
    padding: 10px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 50px 50px 50px 0px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

/* Primary buttons (Avanti, Invia) - filled */
.register-gf-form .gform_next_button,
.register-gf-form .gform_button {
    background-color: #F5710C !important;
    border-color: #F5710C !important;
    color: #fff !important;
}

.register-gf-form .gform_next_button:hover,
.register-gf-form .gform_button:hover {
    background-color: #e06000 !important;
    border-color: #e06000 !important;
}

/* Secondary button (Indietro) - outline */
.register-gf-form .gform_previous_button {
    background-color: transparent !important;
    border-color: #f5710c !important;
    color: #f5710c !important;
}

.register-gf-form .gform_previous_button:hover {
    background-color: #f5710c !important;
    color: #fff !important;
}
