/* Estilos aislados del plugin — evitan conflictos con el tema WordPress */

.scc-form-wrapper {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.25rem;
    box-sizing: border-box;
    font-family: inherit;
    color: #1a1a1a !important;
    background: transparent;
    overflow-x: hidden;
}

.scc-form-wrapper .scc-section {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.65rem 0.85rem 0.85rem;
    margin-bottom: 1rem;
    background: #fff !important;
    box-sizing: border-box;
    max-width: 100%;
}

.scc-form-wrapper .scc-section-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #1a1a1a !important;
    background: #fff !important;
    text-transform: none !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    clip: auto !important;
    clip-path: none !important;
}

.scc-form-wrapper .scc-section-title--main {
    font-size: 1.2rem !important;
    text-align: center;
    margin: 0 !important;
}

.scc-form-wrapper .scc-section-header {
    text-align: center;
}

.scc-form-wrapper .scc-plugin-version {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0.35rem 0 0 !important;
    padding: 0 !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #555 !important;
    background: transparent !important;
    text-align: center !important;
}

.scc-form-wrapper .scc-grid {
    display: grid;
    gap: 0.45rem 0.75rem;
}

.scc-form-wrapper .scc-grid-trabajo {
    grid-template-columns: 6.5rem minmax(120px, 1.6fr) 7.5rem 9.5rem 7rem 6rem;
    gap: 0.35rem 0.45rem;
    align-items: end;
    width: 100%;
}

.scc-form-wrapper .scc-field-anotaciones {
    margin-top: 0.55rem;
}

.scc-form-wrapper .scc-field-anotaciones textarea {
    width: 100%;
    min-height: 4.5rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid #aaa;
    border-radius: 3px;
    box-sizing: border-box;
    font-size: 0.9rem;
    color: #1a1a1a !important;
    background: #fff !important;
    resize: vertical;
}

.scc-form-wrapper .scc-field-tipo select {
    width: 100%;
    min-width: 0;
}

.scc-form-wrapper .scc-field-nombre {
    min-width: 0;
}

.scc-form-wrapper .scc-field-sm input[type="text"],
.scc-form-wrapper .scc-field-sm input[type="tel"],
.scc-form-wrapper .scc-field-sm input[type="email"] {
    padding: 0.3rem 0.4rem;
    font-size: 0.85rem;
}

.scc-form-wrapper .scc-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.scc-form-wrapper .scc-field-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    color: #333333 !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    clip: auto !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    position: static !important;
}

.scc-form-wrapper .scc-form input[type="text"],
.scc-form-wrapper .scc-form input[type="tel"],
.scc-form-wrapper .scc-form input[type="email"],
.scc-form-wrapper .scc-form input[type="number"],
.scc-form-wrapper .scc-form select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid #aaa;
    border-radius: 3px;
    box-sizing: border-box;
    font-size: 0.9rem;
    color: #1a1a1a !important;
    background: #fff !important;
}

.scc-form-wrapper .scc-lines-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.scc-form-wrapper .scc-lines-legend {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.75rem;
    margin: 0 0 0 auto !important;
    padding: 0.35rem 0.55rem !important;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
    color: #444 !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #fafafa !important;
    flex: 1 1 auto;
    max-width: 100%;
}

.scc-form-wrapper .scc-lines-legend span {
    white-space: nowrap;
}

.scc-form-wrapper .scc-lines-legend strong {
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

.scc-form-wrapper .scc-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.scc-form-wrapper .scc-lines-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 880px;
}

.scc-form-wrapper .scc-lines-table th,
.scc-form-wrapper .scc-lines-table td {
    border: 1px solid #bbb;
    padding: 0.3rem;
    vertical-align: middle;
}

.scc-form-wrapper .scc-lines-table thead th {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
}

.scc-form-wrapper .scc-lines-table thead th.scc-th-group {
    border-bottom: 1px solid #1a252f;
}

.scc-form-wrapper .scc-lines-table tbody td {
    background: #fff;
}

.scc-form-wrapper .scc-lines-table input[type="text"],
.scc-form-wrapper .scc-lines-table input[type="number"] {
    width: 100%;
    padding: 0.3rem 0.35rem;
    font-size: 0.85rem;
    color: #1a1a1a !important;
    background: #fff !important;
    box-sizing: border-box;
}

.scc-form-wrapper .scc-col-material {
    min-width: 14rem;
    width: 26%;
}

.scc-form-wrapper .scc-col-desc {
    min-width: 5rem;
    width: 9%;
}

.scc-form-wrapper .scc-col-medida {
    width: 4.2rem;
    min-width: 4.2rem;
    max-width: 4.2rem;
}

.scc-form-wrapper .scc-col-medida input[type="text"] {
    min-width: 0;
    padding: 0.3rem 0.25rem;
    text-align: center;
    font-size: 0.85rem;
}

.scc-form-wrapper .scc-lines-table .scc-col-cant {
    width: 3.5rem;
}

.scc-form-wrapper .scc-lines-table .scc-col-canto {
    width: 2.2rem;
    text-align: center;
}

.scc-form-wrapper .scc-col-canto input[type="checkbox"] {
    display: block;
    width: 1rem;
    height: 1rem;
    margin: 0 auto;
    cursor: pointer;
    accent-color: #2c5f2d;
}

.scc-form-wrapper .scc-col-canto .scc-input-bisagras {
    min-width: 0;
    padding: 0.3rem 0.1rem;
    text-align: center;
}

.scc-form-wrapper .scc-col-actions {
    width: 2.2rem;
    min-width: 2.2rem;
    max-width: 2.2rem;
    text-align: center;
    vertical-align: middle;
    padding: 0.25rem 0.15rem;
}

.scc-form-wrapper .scc-col-actions .scc-remove-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    min-width: 0;
    padding: 0;
    margin: 0;
    font-size: 1.15rem;
    line-height: 1;
    box-sizing: border-box;
}

.scc-form-wrapper .scc-line-row--incomplete {
    background-color: #fff8f8 !important;
}

.scc-form-wrapper .scc-line-row--incomplete td {
    background-color: #fff8f8 !important;
}

.scc-form-wrapper .scc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.scc-form-wrapper .scc-btn-draft {
    background: #e67e22 !important;
    color: #fff !important;
}

.scc-form-wrapper .scc-actions .scc-btn-draft,
.scc-form-wrapper .scc-actions .scc-btn-primary {
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.scc-form-wrapper .scc-actions .scc-btn-draft:active:not(:disabled),
.scc-form-wrapper .scc-actions .scc-btn-primary:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 0 0 transparent;
}

.scc-form-wrapper .scc-actions .scc-btn-draft:active:not(:disabled) {
    background: #c96a14 !important;
}

.scc-form-wrapper .scc-actions .scc-btn-primary:active:not(:disabled) {
    background: #1f4a20 !important;
}

.scc-form-wrapper .scc-btn-draft:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.scc-form-wrapper .scc-section-privacy .scc-privacy-row {
    margin: 0;
}

.scc-form-wrapper .scc-privacy-label {
    display: flex !important;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.9rem !important;
    color: #222 !important;
    cursor: pointer;
    line-height: 1.4 !important;
}

.scc-form-wrapper .scc-privacy-label input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    accent-color: #2c5f2d;
}

.scc-form-wrapper .scc-privacy-label a {
    color: #1a5fb4 !important;
    text-decoration: underline;
}

.scc-form-wrapper .scc-btn {
    border: none;
    border-radius: 4px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.scc-form-wrapper .scc-btn-primary {
    background: #2c5f2d !important;
    color: #fff !important;
}

.scc-form-wrapper .scc-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.scc-form-wrapper .scc-btn-secondary {
    background: #e8e8e8 !important;
    color: #222 !important;
}

.scc-form-wrapper .scc-btn-add-line {
    background: #1a5fb4 !important;
    color: #fff !important;
}

.scc-form-wrapper .scc-btn-add-line,
.scc-form-wrapper .scc-btn-load-ref {
    padding: 0.32rem 0.65rem !important;
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
    white-space: nowrap;
}

.scc-form-wrapper .scc-btn-danger {
    background: #c0392b !important;
    color: #fff !important;
    min-width: 1.8rem;
    padding: 0.25rem 0.4rem;
    line-height: 1;
}

.scc-form-wrapper .scc-message {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 4px;
}

.scc-form-wrapper .scc-message.is-success {
    background: #e8f5e9;
    color: #1b5e20 !important;
    border: 1px solid #a5d6a7;
}

.scc-form-wrapper .scc-message.is-error {
    background: #ffebee;
    color: #b71c1c !important;
    border: 1px solid #ef9a9a;
}

.scc-confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background: rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    font-family: inherit;
    color: #1a1a1a;
}

.scc-confirm-dialog[hidden] {
    display: none !important;
}

.scc-confirm-dialog__panel {
    width: min(100%, 32rem);
    max-height: min(85vh, 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem 1.35rem;
    border-radius: 6px;
    background: #fff !important;
    border: 1px solid #ccc;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
}

.scc-confirm-dialog__text {
    margin: 0 0 1rem 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
    color: #1a1a1a !important;
    white-space: pre-line;
}

.scc-confirm-dialog .scc-btn {
    border: none;
    border-radius: 4px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.scc-confirm-dialog .scc-btn-primary {
    background: #2c5f2d !important;
    color: #fff !important;
}

body.scc-dialog-open {
    overflow: hidden;
}

.scc-email-verify-dialog .scc-email-verify-field {
    display: block;
    margin: 0 0 0.75rem 0;
}

.scc-email-verify-dialog .scc-email-verify-label {
    display: block;
    text-align: center;
    margin-bottom: 0.65rem;
}

.scc-email-verify-dialog .scc-otp-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    margin: 0 auto;
    max-width: 100%;
}

.scc-email-verify-dialog .scc-otp-digit {
    width: 2.65rem;
    height: 3.1rem;
    padding: 0;
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    border: 1px solid #c7c7cc;
    border-radius: 10px;
    background: #f2f2f7;
    color: #1a1a1a !important;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    caret-color: #007aff;
}

.scc-email-verify-dialog .scc-otp-digit:focus {
    outline: none;
    border-color: #007aff;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.22);
}

.scc-email-verify-dialog .scc-otp-digit.scc-input--invalid {
    border-color: #c62828 !important;
    background: #fff8f8 !important;
    box-shadow: none;
}

.scc-email-verify-dialog .scc-email-verify-error {
    margin: 0 0 0.75rem 0 !important;
    font-size: 0.88rem !important;
    line-height: 1.4 !important;
    color: #b71c1c !important;
}

.scc-email-verify-dialog .scc-email-verify-error[hidden] {
    display: none !important;
}

.scc-email-verify-dialog .scc-email-verify-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.scc-email-verify-dialog .scc-btn-secondary {
    background: #f5f5f5 !important;
    color: #1a1a1a !important;
    border: 1px solid #ccc !important;
}

.scc-form-wrapper .scc-input--invalid {
    border-color: #c62828 !important;
    background-color: #fff8f8 !important;
}

.scc-form-wrapper .scc-privacy-row--invalid {
    border: 1px solid #ef9a9a;
    border-radius: 4px;
    padding: 0.45rem 0.55rem;
    background: #fff8f8 !important;
}

@media (max-width: 768px) {
    .scc-confirm-dialog {
        align-items: center;
    }

    .scc-confirm-dialog__panel {
        width: 100%;
        padding: 1rem 1.1rem 1.1rem;
    }

    .scc-confirm-dialog__text {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    .scc-confirm-dialog .scc-btn {
        min-height: 2.75rem;
        font-size: 1rem;
    }

    .scc-email-verify-dialog .scc-otp-inputs {
        gap: 0.35rem;
    }

    .scc-email-verify-dialog .scc-otp-digit {
        width: 2.35rem;
        height: 2.85rem;
        font-size: 1.3rem;
        border-radius: 8px;
    }
}

@media (max-width: 900px) {
    .scc-form-wrapper .scc-grid-trabajo {
        grid-template-columns: 6rem minmax(100px, 1.4fr) 7rem 8.5rem 6.5rem 5.5rem;
    }
}

/* Móvil: datos del trabajo en filas apiladas */
@media (max-width: 768px) {
    .scc-form-wrapper .scc-section-title--main {
        font-size: 1.1rem !important;
    }

    .scc-form-wrapper .scc-section {
        padding: 0.6rem 0.65rem 0.75rem;
    }

    .scc-form-wrapper .scc-grid-trabajo {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 0.55rem;
        overflow: visible;
    }

    .scc-form-wrapper .scc-grid-trabajo .scc-field,
    .scc-form-wrapper .scc-grid-trabajo .scc-field-nombre,
    .scc-form-wrapper .scc-grid-trabajo .scc-field-sm {
        width: 100%;
        min-width: 0;
        flex: none;
    }

    .scc-form-wrapper .scc-grid-trabajo .scc-field-sm input[type="text"],
    .scc-form-wrapper .scc-grid-trabajo .scc-field-sm input[type="tel"],
    .scc-form-wrapper .scc-grid-trabajo .scc-field-sm input[type="email"],
    .scc-form-wrapper .scc-grid-trabajo .scc-field-nombre input[type="text"],
    .scc-form-wrapper .scc-grid-trabajo .scc-field-tipo select {
        font-size: 16px;
        padding: 0.45rem 0.5rem;
    }

    .scc-form-wrapper .scc-lines-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .scc-form-wrapper .scc-lines-legend {
        font-size: 0.7rem !important;
        margin-left: 0 !important;
        justify-content: flex-start;
    }

    .scc-form-wrapper .scc-field-anotaciones textarea {
        font-size: 16px;
    }

    .scc-form-wrapper .scc-lines-table input[type="text"],
    .scc-form-wrapper .scc-lines-table input[type="number"] {
        font-size: 16px;
        padding: 0.25rem 0.2rem;
    }

    .scc-form-wrapper .scc-lines-legend span {
        white-space: normal;
    }

    .scc-form-wrapper .scc-btn {
        width: 100%;
        box-sizing: border-box;
    }

    .scc-form-wrapper .scc-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .scc-form-wrapper .scc-actions .scc-btn-draft {
        order: 1;
    }

    .scc-form-wrapper .scc-actions .scc-btn-primary {
        order: 2;
    }

    .scc-form-wrapper .scc-lines-toolbar .scc-btn-add-line {
        width: auto;
        align-self: flex-start;
    }

    .scc-form-wrapper .scc-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        width: 100%;
    }

    .scc-form-wrapper .scc-lines-table {
        min-width: 700px;
    }

    .scc-form-wrapper .scc-lines-table thead th {
        font-size: 0.68rem !important;
        padding: 0.2rem 0.15rem;
    }

    .scc-form-wrapper .scc-col-material {
        min-width: 5.5rem;
        width: auto;
    }

    .scc-form-wrapper .scc-col-desc {
        min-width: 4rem;
        width: auto;
    }

    .scc-form-wrapper .scc-col-medida {
        width: 3.6rem;
        min-width: 3.6rem;
        max-width: 3.6rem;
    }

    .scc-form-wrapper .scc-lines-table .scc-col-cant {
        width: 2.4rem;
    }

    .scc-form-wrapper .scc-lines-table .scc-col-canto {
        width: 1.6rem;
    }

    .scc-form-wrapper .scc-col-canto input[type="checkbox"] {
        width: 0.85rem;
        height: 0.85rem;
    }

    .scc-form-wrapper .scc-col-canto .scc-input-bisagras {
        min-width: 0;
        padding: 0.2rem 0.05rem;
    }

    .scc-form-wrapper .scc-col-actions {
        width: 1.8rem;
        min-width: 1.8rem;
        max-width: 1.8rem;
        padding: 0.2rem 0.1rem;
    }

    .scc-form-wrapper .scc-col-actions .scc-remove-line {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 1.05rem;
    }
}

.scc-form-wrapper .scc-ref-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.6rem;
    align-items: center;
}

.scc-form-wrapper .scc-ref-label {
    display: block !important;
    visibility: visible !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.3 !important;
    flex: 1 1 auto;
    min-width: 0;
}

.scc-form-wrapper .scc-ref-input {
    width: 9.5rem;
    max-width: 100%;
    padding: 0.35rem 0.45rem;
    border: 1px solid #aaa;
    border-radius: 3px;
    box-sizing: border-box;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1a1a !important;
    background: #fff !important;
}

.scc-form-wrapper .scc-ref-active {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #c5d9c5;
    border-radius: 4px;
    background: #f4faf4 !important;
}

.scc-form-wrapper .scc-ref-active-text {
    margin: 0 0 0.5rem;
    color: #1a1a1a !important;
}

.scc-form-wrapper .scc-ref-active-text strong {
    font-family: ui-monospace, Consolas, monospace;
    letter-spacing: 0.06em;
}

.scc-form-wrapper .scc-btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .scc-form-wrapper .scc-ref-row {
        flex-direction: column;
        align-items: stretch;
    }

    .scc-form-wrapper .scc-ref-input {
        width: 100%;
    }

    .scc-form-wrapper .scc-ref-row .scc-btn-load-ref {
        width: 100%;
    }
}
