/* ── Storme Nicoka Forms ────────────────────────────────────────────────────── */

.sn-form-wrap {
    max-width: 800px;
    margin: 0 auto;
}

/* ── Notices ─────────────────────────────────────────────────────────────────── */

.sn-notice {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.sn-notice--success {
    background: #f0faf0;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.sn-notice--error {
    background: #fff4f4;
    border: 1px solid #ef5350;
    color: #c62828;
}

/* ── Onglets ─────────────────────────────────────────────────────────────────── */

.sn-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
}

.sn-tab {
    padding: 0.6rem 1.1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
    transition: color 0.2s, border-color 0.2s;
}

.sn-tab:hover {
    color: var(--e-global-color-accent, #2563eb);
}

.sn-tab--active {
    color: var(--e-global-color-accent, #2563eb);
    border-bottom-color: var(--e-global-color-accent, #2563eb);
}

.sn-tab-panel {
    display: none;
}

.sn-tab-panel--active {
    display: block;
}

/* ── Grille formulaire ───────────────────────────────────────────────────────── */

.sn-form__row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0;
}

.sn-form__row--2col > .sn-field {
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 600px) {
    .sn-form__row--2col {
        flex-direction: column;
        gap: 0;
    }
}

/* ── Champs ──────────────────────────────────────────────────────────────────── */

.sn-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.sn-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.sn-required {
    color: #ef4444;
    margin-left: 2px;
}

.sn-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0.25rem 0 0;
}

.sn-input,
.sn-select,
.sn-textarea {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #111827;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.sn-input:focus,
.sn-select:focus,
.sn-textarea:focus {
    outline: none;
    border-color: var(--e-global-color-accent, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--e-global-color-accent, #2563eb) 15%, transparent);
}

.sn-input.sn-error,
.sn-select.sn-error {
    border-color: #ef4444;
}

.sn-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ── Téléphone & sélecteur indicatif ────────────────────────────────────────── */

.sn-phone-wrap {
    display: flex;
    gap: 0.5rem;
    position: relative;
    align-items: stretch;
}

.sn-prefix-select {
    position: relative;
    flex: 0 0 auto;
}

.sn-prefix-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
    min-height: 42px;
}

.sn-prefix-btn:focus,
.sn-prefix-btn:hover {
    outline: none;
    border-color: var(--e-global-color-accent, #2563eb);
}

.sn-prefix-dropdown {
    display: none !important;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    width: 280px;
    overflow: hidden;
}

.sn-prefix-dropdown.sn-open {
    display: block !important;
}

.sn-prefix-search {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.sn-prefix-list {
    max-height: 240px;
    overflow-y: auto;
    list-style: none !important;
    margin: 0 !important;
    padding: 0.25rem 0 !important;
}

.sn-prefix-list li {
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    list-style: none !important;
    margin: 0 !important;
}

.sn-prefix-list li::before,
.sn-prefix-list li::after {
    display: none !important;
}

.sn-prefix-list li:hover,
.sn-prefix-list li.sn-selected {
    background: color-mix(in srgb, var(--e-global-color-accent, #2563eb) 8%, transparent);
}

.sn-prefix-list li.sn-hidden {
    display: none !important;
}

.sn-prefix-code {
    color: #6b7280;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ── Dropzone ────────────────────────────────────────────────────────────────── */

.sn-dropzone {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.sn-dropzone:hover,
.sn-dropzone.sn-drag-over {
    border-color: var(--e-global-color-accent, #2563eb);
    background: color-mix(in srgb, var(--e-global-color-accent, #2563eb) 5%, transparent);
}

.sn-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.sn-dropzone__inner {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    pointer-events: none;
}

.sn-dropzone__inner svg {
    margin: 0 auto 0.75rem;
    display: block;
    color: #9ca3af;
}

.sn-dropzone__inner p {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
}

.sn-dropzone__hint {
    font-size: 0.8rem !important;
    color: #9ca3af;
}

.sn-dropzone__link {
    color: var(--e-global-color-accent, #2563eb);
    text-decoration: underline;
}

.sn-dropzone__preview {
    padding: 0.875rem 1rem;
    background: #f0faf0;
    border-top: 1px solid #d1d5db;
    border-radius: 0 0 6px 6px;
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Radios & Checkboxes ─────────────────────────────────────────────────────── */

.sn-radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.sn-radio,
.sn-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

.sn-radio input,
.sn-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--e-global-color-accent, #2563eb);
    cursor: pointer;
    flex-shrink: 0;
}

.sn-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

/* ── Consentement ────────────────────────────────────────────────────────────── */

.sn-consent {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
}

.sn-consent input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--e-global-color-accent, #2563eb);
    cursor: pointer;
    flex-shrink: 0;
}

.sn-consent a {
    color: var(--e-global-color-accent, #2563eb);
}

/* ── Champs conditionnels ────────────────────────────────────────────────────── */

.sn-conditional {
    display: none;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.25rem;
}

.sn-conditional--visible {
    display: block;
}

/* ── Tags mobilité ───────────────────────────────────────────────────────────── */

.sn-mobility-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sn-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 0;
}

.sn-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: color-mix(in srgb, var(--e-global-color-accent, #2563eb) 12%, transparent);
    color: var(--e-global-color-accent, #2563eb);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.sn-tag__remove {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    border: none;
    background: none;
    color: inherit;
    padding: 0;
}

.sn-tag__remove:hover {
    opacity: 1;
}

/* ── Navigation onglets ──────────────────────────────────────────────────────── */

.sn-tab-nav {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* ── Boutons ─────────────────────────────────────────────────────────────────── */

.sn-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.75rem;
    background: var(--e-global-color-accent, #2563eb);
    color: #fff;
    border: 2px solid var(--e-global-color-accent, #2563eb);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}

.sn-btn:hover {
    opacity: 0.88;
}

.sn-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sn-btn--outline {
    background: transparent;
    color: var(--e-global-color-accent, #2563eb);
}

.sn-btn--outline:hover {
    background: color-mix(in srgb, var(--e-global-color-accent, #2563eb) 8%, transparent);
    opacity: 1;
}

/* ── Loader ──────────────────────────────────────────────────────────────────── */

.sn-btn__loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sn-spin 0.7s linear infinite;
}

.sn-btn--outline .sn-btn__loader {
    border-color: color-mix(in srgb, var(--e-global-color-accent, #2563eb) 30%, transparent);
    border-top-color: var(--e-global-color-accent, #2563eb);
}

@keyframes sn-spin {
    to { transform: rotate(360deg); }
}
