/* ===================================================
   Auth Modal — Nesepora
   =================================================== */

/* Backdrop + positioning */
.nsp-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nsp-modal.is-open {
    pointer-events: all;
    opacity: 1;
}

.nsp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(51, 51, 51, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Box */
.nsp-modal__box {
    position: relative;
    background: #fff;
    border-radius: 1.5rem;
    padding: 2.5rem 2rem 2rem;
    width: 100%;
    max-width: 460px;
    max-height: 90dvh;
    overflow-y: auto;
    transform: translateY(12px);
    transition: transform 0.3s ease;
    scrollbar-width: none;
}

.nsp-modal__box::-webkit-scrollbar { display: none; }

.nsp-modal.is-open .nsp-modal__box {
    transform: translateY(0);
}

/* Close button */
.nsp-modal__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: #f2f3f4;
    border: none;
    border-radius: 999px;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5a656f;
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.nsp-modal__close:hover {
    background-color: var(--modal-accent-light, #edf7f2);
    color: var(--modal-accent, #499772);
}

/* Tabs */
.nsp-modal__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid #e5e8e9;
}

.nsp-modal__tab {
    background: none;
    border: none;
    padding: 0 0 0.875rem;
    margin-right: 1.5rem;
    font-family: "Museo Sans Cyrl", sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: #5a656f;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nsp-modal__tab.is-active {
    color: var(--modal-accent, #499772);
    border-bottom-color: var(--modal-accent, #499772);
    font-weight: 500;
}

/* Panels */
.nsp-modal__panel {
    display: none;
}

.nsp-modal__panel.is-active {
    display: block;
}

/* Labels */
.nsp-modal__box label {
    font-family: "Museo Sans Cyrl", sans-serif;
    font-size: 0.8125rem;
    font-weight: 300;
    color: #5a656f;
    display: block;
    margin-bottom: 0.35rem;
}

.nsp-modal__box label .required {
    color: var(--modal-accent, #499772);
    margin-left: 2px;
}

/* Inputs */
.nsp-modal__box input[type="text"],
.nsp-modal__box input[type="email"],
.nsp-modal__box input[type="password"],
.nsp-modal__box input[type="tel"] {
    appearance: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 0.875rem;
    padding: 0 1.125rem;
    background: #f2f3f4;
    font-family: "Museo Sans Cyrl", sans-serif;
    font-size: 0.9375rem;
    color: #333;
    min-height: 3.5rem;
    outline: none;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.nsp-modal__box input[type="text"]:focus,
.nsp-modal__box input[type="email"]:focus,
.nsp-modal__box input[type="password"]:focus,
.nsp-modal__box input[type="tel"]:focus {
    background: #fff;
    box-shadow: 0 0 0 1.5px #e5e8e9;
}

.nsp-modal__box input::placeholder {
    color: #b0b8be;
}

/* Form rows */
.nsp-modal__box .form-row,
.nsp-modal__box .woocommerce-form-row {
    margin-bottom: 1rem;
}

/* Two columns (first + last name) */
.nsp-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 400px) {
    .nsp-row-2 { grid-template-columns: 1fr; }
}

/* Remember me */
.nsp-remember {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 1.25rem;
    font-size: 0.875rem !important;
    color: #5a656f !important;
}

.nsp-remember input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-height: unset;
    accent-color: var(--modal-accent, #499772);
    cursor: pointer;
}

/* Submit */
.nsp-modal__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    border-radius: 999px;
    min-height: 3.5rem;
    padding: 0 2rem;
    background: var(--modal-accent, #499772) !important;
    color: #fff;
    font-family: "Museo Sans Cyrl", sans-serif;
    font-size: 1rem;
    font-weight: 300;
    cursor: pointer;
    transition: background-color 0.5s ease;
    margin-top: 0.5rem;
}

.nsp-modal__submit:hover {
    background: var(--modal-accent, #499772) !important;
    filter: brightness(1.15);
    opacity: 0.92;
}

/* Lost password */
.nsp-lost-password {
    text-align: center;
    margin-top: 1rem;
}

.nsp-lost-password a {
    font-family: "Museo Sans Cyrl", sans-serif;
    font-size: 0.8125rem;
    color: var(--modal-accent, #499772);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.nsp-lost-password a:hover {
    border-bottom-color: var(--modal-accent, #499772);
}

/* Privacy policy */
.nsp-modal__box .woocommerce-privacy-policy-text {
    font-family: "Museo Sans Cyrl", sans-serif;
    font-size: 0.75rem;
    color: #5a656f;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.nsp-modal__box .woocommerce-privacy-policy-text a {
    color: var(--modal-accent, #499772);
}

/* Inline alert messages */
.nsp-alert {
    padding: 0.75rem 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-family: "Museo Sans Cyrl", sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: block;
}

.nsp-alert--error {
    border-left: 3px solid var(--modal-accent, #499772);
    background: var(--modal-accent-light, #edf7f2);
    color: #333;
}

.nsp-alert--success {
    border-left: 3px solid #52A97F;
    background: #f0faf5;
    color: #333;
}

/* WooCommerce error notices inside modal */
.nsp-modal__box .woocommerce-error,
.nsp-modal__box .woocommerce-message {
    list-style: none;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--modal-accent, #499772);
    background: var(--modal-accent-light, #edf7f2);
    border-radius: 0 0.5rem 0.5rem 0;
    font-family: "Museo Sans Cyrl", sans-serif;
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 1rem;
}

.nsp-modal__box .woocommerce-error::before {
    display: none;
}

/* Header account button */
.nsp-account-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    transition: opacity 0.3s ease;
    padding: 0;
    text-decoration: none;
}

.nsp-account-btn:hover {
    opacity: 0.7;
}

/* Lock scroll when modal open */
body.nsp-modal-open {
    overflow: hidden;
}

/* ── Page (inline) variant — /my-account/ for guests ── */
.nsp-modal--page {
    position: static;
    opacity: 1;
    pointer-events: all;
    padding: 0;
    display: block;
    min-height: unset;
}

.nsp-modal--page .nsp-modal__backdrop {
    display: none;
}

.nsp-modal--page .nsp-modal__box {
    max-width: 480px;
    margin: 0 auto;
    transform: none;
    max-height: none;
    box-shadow: 0 4px 32px rgba(0,0,0,0.06);
}

