/* ================================================================
   Nautica Scadenze — Frontend CSS
   Usa le variabili CSS del tema attivo dove possibile.
   Le classi ns-* non interferiscono con il tema.
   ================================================================ */

/* ── Contenitore principale ── */
.ns-wrap {
    --ns-brand-blue: #00467a;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    font-family: inherit;
    color: inherit;
}

/* ── Card ── */
.ns-card {
    background: var(--wp--preset--color--background, #fff);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 10px;
    padding: 36px 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .ns-card { padding: 24px 20px; }
}

/* ── Titolo form ── */
.ns-card__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--wp--preset--color--primary, var(--ns-brand-blue));
    color: var(--wp--preset--color--primary, var(--ns-brand-blue));
    display: flex;
    align-items: center;
    gap: 10px;
}

.ns-card__title .ns-icon {
    font-size: 1.5rem;
}

/* ── Form groups ── */
.ns-form-group {
    margin-bottom: 20px;
}

.ns-form-group label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 6px;
    color: inherit;
}

.ns-form-group .ns-required {
    color: #e53e3e;
    margin-left: 2px;
}

.ns-form-group input[type="text"],
.ns-form-group input[type="email"],
.ns-form-group input[type="tel"],
.ns-form-group input[type="password"],
.ns-form-group input[type="date"],
.ns-form-group input[type="number"],
.ns-form-group textarea,
.ns-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: inherit;
    background: #fff;
    transition: border-color .2s;
    box-sizing: border-box;
}

.ns-form-group input:focus,
.ns-form-group textarea:focus,
.ns-form-group select:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary, var(--ns-brand-blue));
    box-shadow: 0 0 0 3px rgba(0,70,122,.12);
}

.ns-form-group textarea {
    min-height: 90px;
    resize: vertical;
}

.ns-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .ns-form-row { grid-template-columns: 1fr; }
}

/* ── Checkbox remember ── */
.ns-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
}

.ns-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--wp--preset--color--primary, var(--ns-brand-blue));
}

/* ── Bottoni ── */
.ns-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    text-decoration: none;
    line-height: 1;
}

.ns-btn:hover { opacity: .88; text-decoration: none; }
.ns-btn:active { transform: scale(.98); }

.ns-btn--primary {
    background: var(--wp--preset--color--primary, var(--ns-brand-blue));
    color: #fff !important;
    border: 1px solid var(--wp--preset--color--primary, var(--ns-brand-blue));
    width: 100%;
    margin-top: 8px;
}

.ns-btn--primary:hover {
    background: #fff;
    color: var(--wp--preset--color--primary, var(--ns-brand-blue)) !important;
    opacity: 1;
}

.ns-btn--danger {
    background: #e53e3e;
    color: #fff !important;
    padding: 6px 14px;
    font-size: .82rem;
}

.ns-btn--sm {
    padding: 6px 14px;
    font-size: .82rem;
}

/* ── Alert / notice ── */
.ns-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: .93rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ns-notice::before { font-size: 1rem; }

.ns-notice--error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.ns-notice--error::before { content: '⚠️'; }

.ns-notice--success {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #276749;
}

.ns-notice--success::before { content: '✅'; }

/* ── Link navigazione auth ── */
.ns-auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: .88rem;
    color: #666;
}

.ns-auth-links a {
    color: var(--wp--preset--color--primary, var(--ns-brand-blue));
    font-weight: 600;
}

/* ── Area personale: toolbar + form a scomparsa ── */
.ns-personal-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ns-personal-toolbar__title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ns-personal-heading {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.ns-personal-count {
    font-size: .85rem;
    color: #888;
}

.ns-btn--inline {
    width: auto;
    margin-top: 0;
}

.ns-btn__icon {
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ns-btn--add-toggle[aria-expanded="true"] .ns-btn__icon {
    transform: rotate(45deg);
}

.ns-btn--ghost {
    background: transparent;
    color: var(--wp--preset--color--primary, var(--ns-brand-blue)) !important;
    border: 1.5px solid rgba(0, 70, 122, 0.35);
}

.ns-btn--ghost:hover {
    background: rgba(0, 70, 122, 0.06);
    opacity: 1;
}

/* Animazione altezza (grid) + contenuto */
.ns-add-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.ns-add-panel.is-open {
    grid-template-rows: 1fr;
}

.ns-add-panel__inner {
    min-height: 0;
    overflow: hidden;
}

.ns-add-panel__box {
    margin-bottom: 20px;
    padding: 24px 22px;
    border-radius: 10px;
    border: 1px solid rgba(0, 70, 122, 0.18);
    background: linear-gradient(165deg, rgba(0, 70, 122, 0.04) 0%, rgba(255, 255, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: translateY(-10px);
    transition:
        opacity 0.32s ease 0.06s,
        transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.ns-add-panel.is-open .ns-add-panel__box {
    opacity: 1;
    transform: translateY(0);
}

.ns-add-panel:not(.is-open) .ns-add-panel__box {
    transition:
        opacity 0.22s ease,
        transform 0.28s ease;
}

.ns-add-panel__lead {
    margin: 0 0 18px;
    font-size: .92rem;
    color: #555;
}

.ns-add-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.ns-add-panel__actions .ns-btn--primary {
    min-width: 160px;
}

/* ── Intestazione area scadenze ── */
.ns-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.ns-header__user {
    font-size: .9rem;
    color: #666;
}

.ns-profile-link {
    font-size: .85rem;
    color: var(--wp--preset--color--primary, var(--ns-brand-blue)) !important;
    text-decoration: none;
    margin-left: 12px;
}

.ns-logout-link {
    font-size: .85rem;
    color: #e53e3e !important;
    text-decoration: none;
    margin-left: 12px;
}

.ns-danger-zone {
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 16px;
    background: #fff5f5;
}

/* ── Filtri ── */
.ns-filters {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ns-filter-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid #ddd;
    background: #fff;
    font-size: .85rem;
    cursor: pointer;
    text-decoration: none;
    color: #555;
    transition: all .2s;
}

.ns-filter-btn:hover,
.ns-filter-btn--active {
    border-color: var(--wp--preset--color--primary, var(--ns-brand-blue));
    background: #fff;
    color: var(--wp--preset--color--primary, var(--ns-brand-blue)) !important;
    text-decoration: none;
}

/* ── Tabella scadenze ── */
.ns-table-wrap {
    overflow-x: auto;
}

.ns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}

.ns-table th {
    text-align: left;
    padding: 10px 14px;
    background: #f7f9fb;
    border-bottom: 2px solid #e2e8f0;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
    white-space: nowrap;
}

.ns-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.ns-table tr:last-child td { border-bottom: none; }

.ns-table tr:hover td { background: #fafcff; }

.ns-table__title {
    font-weight: 600;
}

.ns-table__note {
    font-size: .82rem;
    color: #888;
    margin-top: 3px;
}

/* ── Badge stato ── */
.ns-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.ns-badge--scaduta { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.ns-badge--oggi    { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.ns-badge--urgente { background: #fff7ed; color: #c05621; border: 1px solid #fed7aa; }
.ns-badge--vicina  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ns-badge--ok      { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }

/* ── Vuoto ── */
.ns-empty {
    text-align: center;
    padding: 48px 24px;
    color: #aaa;
}

.ns-empty .ns-empty__icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

/* ── Password toggle ── */
.ns-password-wrap {
    position: relative;
}

.ns-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

/* ── Hint ── */
.ns-hint {
    font-size: .8rem;
    color: #888;
    margin-top: 4px;
}
