/**
 * Substack Widget — Frontend Styles
 */

.sw-widget {
    padding: 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
}

.sw-widget--bare {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.sw-title {
    margin: 0 0 8px;
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

.sw-description {
    margin: 0 0 14px;
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
}

/* -----------------------------------------------------------------------
   Form
----------------------------------------------------------------------- */

.sw-field {
    display: flex;
    gap: 8px;
}

.sw-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    font-size: 0.9em;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s;
    color: #333;
    background: #fff;
}

.sw-input:focus {
    border-color: #FF6719;
}

.sw-btn {
    flex-shrink: 0;
    padding: 9px 18px;
    background: #FF6719;
    color: #fff;
    font-size: 0.9em;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.1s ease;
}

.sw-btn:hover:not(:disabled) {
    background: #e55a10;
    transform: translateY(-1px);
}

.sw-btn:disabled {
    background: #aaa;
    cursor: default;
    transform: none;
}

/* -----------------------------------------------------------------------
   Messaggi
----------------------------------------------------------------------- */

.sw-message {
    margin: 10px 0 0;
    font-size: 0.85em;
    line-height: 1.4;
}

.sw-message--success {
    color: #2e7d32;
}

.sw-message--error {
    color: #c62828;
}

/* -----------------------------------------------------------------------
   Responsive: su schermi molto stretti il bottone va sotto l'input
----------------------------------------------------------------------- */

@media (max-width: 340px) {
    .sw-field {
        flex-direction: column;
    }

    .sw-btn {
        width: 100%;
    }
}

/* -----------------------------------------------------------------------
   Dark skin
----------------------------------------------------------------------- */

html.dark-skin .sw-widget {
    background: #1e1e1e;
    border-color: #333;
}

html.dark-skin .sw-title {
    color: #e8e8e8;
}

html.dark-skin .sw-description {
    color: #aaa;
}

html.dark-skin .sw-input {
    background: #2a2a2a;
    border-color: #444;
    color: #ddd;
}

html.dark-skin .sw-input:focus {
    border-color: #FF6719;
}

html.dark-skin .sw-message--success {
    color: #66bb6a;
}

html.dark-skin .sw-message--error {
    color: #ef5350;
}
