/* ==========================================================================
   Nexus — Trial / "Add New Client" Modal
   Standalone stylesheet. Enqueued from inc/nexus-modal.php as "nexus-modal-trial".
   Uses the native <dialog> element (free focus-trap, ESC-to-close, backdrop).
   Colours follow the Nexus system: brand orange #ef6a30, Inter for form UI.
   Fonts (Inter / Outfit) are already loaded by the theme's main stylesheet.
   ========================================================================== */

/* Overlay */
.nx-modal {
    /* The theme's global reset ( * { margin: 0 } ) removes the <dialog>'s
       default centring margin, so we centre it explicitly. */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    border: none;
    padding: 0;
    width: 92%;
    max-width: 560px;
    max-height: 92vh;
    overflow: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(19, 18, 66, .28);
    color: #170f49;
}
.nx-modal::backdrop {
    background: rgba(20, 20, 22, .55);
}
/* Entrance — fade the dialog and gently rise the inner form, so the centring
   transform on .nx-modal is never overridden by an animation. */
.nx-modal[open] {
    animation: nx-modal-fade .2s ease-out;
}
.nx-modal[open] .nx-modal__form {
    animation: nx-modal-rise .24s ease-out;
}
@keyframes nx-modal-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes nx-modal-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Inner form — padding lives here so a click on the dialog padding = backdrop */
.nx-modal__form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 36px 40px 34px;
    font-family: Inter, sans-serif;
}

.nx-modal__title {
    text-align: center;
    font-family: Outfit, sans-serif;
    font-weight: 700;
    font-size: 26px;
    line-height: 1.2;
    color: #1a1a2b;
    margin-bottom: 4px;
}

/* Close (X) button, top-right */
.nx-modal__close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f3f6;
    color: #6f6c90;
    cursor: pointer;
    line-height: 0;
    transition: background .2s, color .2s;
}
.nx-modal__close:hover { background: #ef6a30; color: #fff; }

/* Inputs */
.nx-input {
    width: 100%;
    height: 56px;
    background: #f3f3f6;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0 20px;
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.1;
    color: #4a4a58;
    transition: background .2s, border-color .2s;
}
.nx-input::placeholder { color: #9a9aa5; }
.nx-input:focus {
    outline: none;
    background: #eef0fb;
    border-color: #aab4f0;
    color: #33334a;
}

/* Upload dropzone */
.nx-upload {
    align-self: flex-start;
    width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 26px 16px;
    border: 1.5px dashed #d9d9df;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.nx-upload:hover { border-color: #ef6a30; background: #fff8f4; }
.nx-upload__icon { color: #b9b9c2; line-height: 0; }
.nx-upload__title { font-weight: 700; font-size: 15px; color: #33334a; }
.nx-upload__hint  { font-size: 12px; color: #9a9aa5; }
.nx-upload__name  { font-size: 12px; color: #ef6a30; word-break: break-all; }

/* Footer actions */
.nx-modal__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.nx-modal__actions-right { display: flex; gap: 12px; }

.nx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    padding: 13px 24px;
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: opacity .2s, background .2s;
}
.nx-btn:hover  { opacity: .88; }
.nx-btn--ghost { background: #fff; border: 1px solid #e2e2e8; color: #33334a; }
.nx-btn--dark  { background: #5c6b7d; color: #fff; }
.nx-btn--primary { background: #ef6a30; color: #fff; }
.nx-btn svg { flex-shrink: 0; }

/* Mobile */
@media (max-width: 47.99875em) {
    .nx-modal__form { padding: 28px 22px 26px; gap: 14px; }
    .nx-modal__title { font-size: 22px; }
    .nx-input { height: 52px; font-size: 15px; }
    .nx-modal__actions { justify-content: stretch; }
    .nx-modal__actions .nx-btn--ghost { flex: 1 1 100%; order: 3; }
    .nx-modal__actions-right { flex: 1 1 100%; }
    .nx-modal__actions-right .nx-btn { flex: 1 1 0; }
}