/* Humo Subscriber Frontend Styles */

.humo-subscriber-form-container {
    max-width: 500px;
    margin: 20px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.humo-subscriber-form-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.humo-subscriber-form-description {
    font-size: 16px;
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.humo-subscriber-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
}

.humo-form-field {
    margin-bottom: 20px;
}

.humo-form-field:last-child {
    margin-bottom: 0;
}

.humo-form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    background-color: #fff;
}

.humo-form-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.humo-form-input:invalid {
    border-color: #dc3232;
}

.humo-form-input::placeholder {
    color: #999;
    opacity: 1;
}

.humo-form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.humo-form-checkbox input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0073aa;
}

.humo-form-checkbox label {
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    margin: 0;
    user-select: none;
}

.humo-form-submit {
    width: 100%;
    padding: 14px 20px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.humo-form-submit:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.humo-form-submit:active {
    transform: translateY(0);
}

.humo-form-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.humo-form-messages {
    margin-bottom: 20px;
    padding: 0;
}

.humo-form-messages.has-message {
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.humo-form-messages.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.humo-form-messages.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.humo-form-messages.loading {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading spinner */
.humo-form-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: humo-spin 1s linear infinite;
    margin-right: 5px;
}

@keyframes humo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 600px) {
    .humo-subscriber-form-container {
        max-width: 100%;
    }
    
    .humo-subscriber-form {
        padding: 20px;
        margin: 0 10px;
    }
    
    .humo-form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .humo-subscriber-form {
        background: #2c3338;
        border-color: #50575e;
        color: #fff;
    }
    
    .humo-subscriber-form-title {
        color: #fff;
    }
    
    .humo-subscriber-form-description {
        color: #b9c5d3;
    }
    
    .humo-form-input {
        background-color: #1e1e1e;
        border-color: #50575e;
        color: #fff;
    }
    
    .humo-form-input::placeholder {
        color: #b9c5d3;
    }
    
    .humo-form-input:focus {
        border-color: #72aee6;
        box-shadow: 0 0 0 3px rgba(114, 174, 230, 0.1);
    }
    
    .humo-form-checkbox label {
        color: #b9c5d3;
    }
    
    .humo-form-submit {
        background-color: #2271b1;
    }
    
    .humo-form-submit:hover {
        background-color: #135e96;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .humo-form-input {
        border-width: 2px;
    }
    
    .humo-form-submit {
        border: 2px solid transparent;
    }
    
    .humo-form-submit:focus {
        outline: 3px solid;
        outline-offset: 2px;
    }
}

/* Animation for form appearance */
.humo-subscriber-form-container {
    animation: humo-fade-in 0.5s ease-out;
}

@keyframes humo-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom styling for specific form states */
.humo-form-field.required .humo-form-input {
    border-left: 4px solid #0073aa;
}

.humo-form-field.error .humo-form-input {
    border-color: #dc3232;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1);
}

.humo-form-field.success .humo-form-input {
    border-color: #46b450;
    box-shadow: 0 0 0 3px rgba(70, 180, 80, 0.1);
}