/* =========================================================
   GTExD UI Core — Forms
   Campi condivisi tra frontend e strumenti admin.
========================================================= */

.gtexd-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.gtexd-field__label,
.gtexd-label {
    color: var(--gtexd-color-text-strong);
    font-family: var(--gtexd-font-body);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.25;
    text-transform: uppercase;
}

.gtexd-field__hint,
.gtexd-help {
    margin: 0;
    color: var(--gtexd-color-muted);
    font-size: 11px;
    line-height: 1.5;
}

.gtexd-input,
.gtexd-select,
.gtexd-textarea,
.gtexd-admin-shell input[type="text"],
.gtexd-admin-shell input[type="email"],
.gtexd-admin-shell input[type="number"],
.gtexd-admin-shell input[type="search"],
.gtexd-admin-shell input[type="url"],
.gtexd-admin-shell select,
.gtexd-admin-shell textarea {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #3C4856;
    border-radius: var(--gtexd-radius-sm);
    background: #0E1319;
    box-shadow: none;
    color: #F4F5F7;
    font-family: var(--gtexd-font-body);
    font-size: 14px;
    line-height: 1.35;
    transition: border-color var(--gtexd-transition), background var(--gtexd-transition), box-shadow var(--gtexd-transition);
}

.gtexd-textarea,
.gtexd-ui textarea,
.gtexd-admin-shell textarea {
    min-height: 120px;
    resize: vertical;
}

.gtexd-input:hover,
.gtexd-select:hover,
.gtexd-textarea:hover,
.gtexd-admin-shell input:hover,
.gtexd-admin-shell select:hover,
.gtexd-admin-shell textarea:hover {
    border-color: #637181;
    background: #10161D;
}

.gtexd-input:focus,
.gtexd-select:focus,
.gtexd-textarea:focus,
.gtexd-admin-shell input:focus,
.gtexd-admin-shell select:focus,
.gtexd-admin-shell textarea:focus {
    border-color: var(--gtexd-color-accent);
    background: #10161D;
    outline: 0;
    box-shadow: 0 0 0 1px var(--gtexd-color-accent);
}

.gtexd-input::placeholder,
.gtexd-textarea::placeholder,
.gtexd-admin-shell input::placeholder,
.gtexd-admin-shell textarea::placeholder {
    color: #7E8996;
    opacity: 1;
}

.gtexd-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--gtexd-color-muted-strong);
    font-size: 12px;
    line-height: 1.5;
}

.gtexd-check input[type="checkbox"],
.gtexd-check input[type="radio"] {
    flex: 0 0 auto;
    margin-top: 2px;
    accent-color: var(--gtexd-color-accent);
}

.gtexd-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gtexd-space-4);
}

.gtexd-form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 760px) {
    .gtexd-form-grid,
    .gtexd-form-grid--3 {
        grid-template-columns: 1fr;
    }
}



/* Select GTExD: chevron esplicito.
   Non dipende dalla freccia nativa del browser/wp-admin, che sul tema scuro
   puo' risultare invisibile o essere soppressa dalle regole di WordPress. */
.gtexd-select,
.gtexd-admin-shell select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px !important;
    background-image:
        linear-gradient(45deg, transparent 50%, #A9B1BB 50%),
        linear-gradient(135deg, #A9B1BB 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.gtexd-admin-shell select:disabled { cursor: not-allowed; }

/* Contrasto coerente anche con i controlli nativi di wp-admin. */
.gtexd-admin-shell select,
.gtexd-admin-shell select option {
    color: #F4F5F7 !important;
    background-color: #0E1319 !important;
}

.gtexd-admin-shell select:disabled,
.gtexd-admin-shell input:disabled,
.gtexd-admin-shell textarea:disabled {
    color: #87919D !important;
    background: #0B0F14 !important;
    opacity: 1;
}

/* =========================================================
   Select shell 1.2.4
   Chevron reale disegnato dal wrapper: non dipende dal rendering
   nativo del browser o dalle regole di wp-admin.
========================================================= */
.gtexd-select-wrap {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.gtexd-select-wrap > select,
.gtexd-admin-shell .gtexd-select-wrap > select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding-right: 52px !important;
    background-image: none !important;
    cursor: pointer;
}

.gtexd-select-wrap::before {
    content: "";
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 42px;
    z-index: 2;
    border-left: 1px solid #3C4856;
    background: rgba(255,255,255,.018);
    pointer-events: none;
    transition: border-color var(--gtexd-transition), background var(--gtexd-transition);
}

.gtexd-select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 17px;
    z-index: 3;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid #DCE2E8;
    border-bottom: 2px solid #DCE2E8;
    transform: rotate(45deg);
    pointer-events: none;
}

.gtexd-select-wrap:hover::before {
    border-left-color: #637181;
    background: rgba(255,255,255,.035);
}

.gtexd-select-wrap:focus-within::before {
    border-left-color: var(--gtexd-color-accent);
    background: rgba(196,32,38,.06);
}

.gtexd-select-wrap--compact {
    width: auto;
    min-width: 235px;
}
