/**
 * Robinson Newsletter Form Styles
 * 
 * Stili per il form di iscrizione alla newsletter Robinson Pet Shop
 * Versione: 1.0.0
 * Autore: Jump Group S.r.l.
 */

/* ==========================================================================
   Contenitore principale
   ========================================================================== */

.robinson-newsletter-wrapper {
    max-width: 500px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
}

/* ==========================================================================
   Form container
   ========================================================================== */

.robinson-newsletter-form {
    background: transparent;
    padding: 0;
    border-radius: 8px;
    border: none;
    box-shadow: none;
    transition: box-shadow 0.3s ease;
}

.robinson-newsletter-form:hover {
    box-shadow: none;
}

/* ==========================================================================
   Campo email
   ========================================================================== */

.robinson-newsletter-field {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

.robinson-newsletter-email {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: transparent;
    color: #fff;
}

.robinson-newsletter-email:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.robinson-newsletter-email:invalid {
    //border-color: rgba(220, 53, 69, 0.8);
}

.robinson-newsletter-email::placeholder {
    color: rgba(255, 255, 255, 0.7);
    opacity: 1;
}

/* ==========================================================================
   Sezione privacy
   ========================================================================== */

.robinson-newsletter-privacy {
    margin-bottom: 20px;
}

.robinson-newsletter-privacy-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.robinson-newsletter-privacy-label:hover {
    color: rgba(255, 255, 255, 1);
}

.robinson-newsletter-privacy-checkbox {
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #67b346;
}

.robinson-newsletter-privacy-text {
    color: rgba(255, 255, 255, 0.9);
    user-select: none;
    margin-left: .5rem;
}

/* ==========================================================================
   Pulsante di invio
   ========================================================================== */

.robinson-newsletter-submit {
    margin-bottom: 0;
}

.robinson-newsletter-button {
    width: auto;
    min-width: 120px;
    background: #67b346;
    color: #fff;
    border: none;
    text-transform: uppercase;
    font-family: "Raleway", "Helvetica", "Arial", sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 32px;
    padding: 4px 20px 3px;
    border-radius: 5px;
    cursor: pointer;
    transition: ease all 0.5s;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}
.robinson-newsletter-button span {
  color: #fff;
  font-weight: 700;
}

.robinson-newsletter-button:hover {
    background: #5a9c3a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(103, 179, 70, 0.3);
}

.robinson-newsletter-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(103, 179, 70, 0.3);
}

.robinson-newsletter-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.robinson-newsletter-button:disabled:hover {
    background: #ccc;
    transform: none;
}

/* ==========================================================================
   Messaggi di stato
   ========================================================================== */

.robinson-newsletter-messages {
    margin-top: 15px;
}

.robinson-newsletter-success,
.robinson-newsletter-error,
.robinson-newsletter-loading {
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

.robinson-newsletter-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.robinson-newsletter-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.robinson-newsletter-loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    text-align: center;
    position: relative;
}

/* Animazione loading */
.robinson-newsletter-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #0c5460;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Animazioni
   ========================================================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .robinson-newsletter-wrapper {
        margin: 15px 0;
    }
    
    .robinson-newsletter-form {
        padding: 20px;
        margin: 0 10px;
    }
    
    .robinson-newsletter-field {
        flex-direction: column;
        gap: 10px;
    }
    
    .robinson-newsletter-email {
        font-size: 16px; /* Previene zoom su iOS */
        width: 100%;
    }
    
    .robinson-newsletter-button {
        width: 100%;
        min-width: auto;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .robinson-newsletter-privacy-label {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .robinson-newsletter-form {
        padding: 15px;
        margin: 0 5px;
    }
    
    .robinson-newsletter-privacy-checkbox {
        margin-top: 1px;
    }
}

/* ==========================================================================
   Accessibilità
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .robinson-newsletter-email,
    .robinson-newsletter-button,
    .robinson-newsletter-form {
        transition: none;
    }
    
    .robinson-newsletter-loading::after {
        animation: none;
    }
    
    .robinson-newsletter-success,
    .robinson-newsletter-error,
    .robinson-newsletter-loading {
        animation: none;
    }
}

/* Focus visibile per navigazione da tastiera */
.robinson-newsletter-privacy-checkbox:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.robinson-newsletter-button:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

/* ==========================================================================
   Temi scuri (opzionale)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .robinson-newsletter-form {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .robinson-newsletter-email {
        background: #3d3d3d;
        border-color: #555;
        color: #fff;
    }
    
    .robinson-newsletter-email::placeholder {
        color: #aaa;
    }
    
    .robinson-newsletter-privacy-text {
        color: #ccc;
    }
}
