/**
 * Proteas Newsletter - Frontend Styles
 *
 * Styles matching the REWIRE newsletter design
 *
 * @package Proteas_Newsletter
 */

/* ============================================
   CSS Custom Properties (Variables)
   ============================================ */
:root {
    --proteas-nl-primary: #495C46;
    --proteas-nl-primary-dark: #3e4a39;
    --proteas-nl-text-light: #ffffff;
    --proteas-nl-input-bg: #ffffff;
    --proteas-nl-input-text: #333333;
    --proteas-nl-input-placeholder: #999999;
    --proteas-nl-link-color: #ffffff;
    --proteas-nl-success: #27ae60;
    --proteas-nl-error: #e74c3c;
}

/* ============================================
   Main Section Container
   ============================================ */
.proteas-newsletter-section {
    background-color: var(--proteas-nl-primary);
    padding: 20px 30px 15px;
    width: 100%;
    box-sizing: border-box;
}

.proteas-newsletter-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ============================================
   Left: Branding (Icon + Title)
   ============================================ */
.proteas-newsletter-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 180px;
}

.proteas-newsletter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--proteas-nl-text-light);
    flex-shrink: 0;
}

.proteas-newsletter-icon svg {
    width: 45px;
    height: 45px;
}

.proteas-newsletter-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--proteas-nl-text-light);
    margin: 0;
    line-height: 1.4;
    max-width: 120px;
}

/* ============================================
   Middle: Description
   ============================================ */
.proteas-newsletter-content {
    flex: 1;
    min-width: 0;
    padding: 0 15px;
}

.proteas-newsletter-description {
    font-size: 0.9rem;
    color: var(--proteas-nl-text-light);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   Right: Form
   ============================================ */
.proteas-newsletter-form {
    flex-shrink: 0;
}

.proteas-newsletter-form-inner {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.proteas-newsletter-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.proteas-newsletter-input-wrapper {
    position: relative;
}

/* Input Fields */
.proteas-newsletter-input {
    width: 150px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--proteas-nl-input-text);
    background: var(--proteas-nl-input-bg);
    border: none;
    border-radius: 0;
    outline: none;
    transition: box-shadow 0.2s ease;
    box-sizing: border-box;
}

.proteas-newsletter-input::placeholder {
    color: var(--proteas-nl-input-placeholder);
    font-style: normal;
}

.proteas-newsletter-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Submit Button - Outline Style */
.proteas-newsletter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--proteas-nl-text-light);
    background: transparent;
    border: 2px solid var(--proteas-nl-text-light);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 90px;
    align-self: stretch;
    position: relative;
}

.proteas-newsletter-button:hover {
    background: var(--proteas-nl-text-light);
    color: var(--proteas-nl-primary);
}

.proteas-newsletter-button:active {
    transform: scale(0.98);
}

.proteas-newsletter-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Button Loading State */
.proteas-newsletter-button-loading {
    display: none;
}

.proteas-newsletter-button.is-loading .proteas-newsletter-button-text {
    visibility: hidden;
}

.proteas-newsletter-button.is-loading .proteas-newsletter-button-loading {
    display: flex;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Spinner Animation */
.proteas-newsletter-spinner {
    width: 18px;
    height: 18px;
    animation: proteas-spin 1s linear infinite;
}

@keyframes proteas-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Privacy Notice
   ============================================ */
.proteas-newsletter-privacy {
    text-align: center;
    margin-top: 12px;
    padding-top: 8px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.proteas-newsletter-privacy p {
    font-size: 0.7rem;
    color: var(--proteas-nl-text-light);
    margin: 0;
}

.proteas-newsletter-privacy a {
    color: var(--proteas-nl-link-color);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.proteas-newsletter-privacy a:hover {
    opacity: 0.8;
}

/* ============================================
   Messages (Success / Error)
   ============================================ */
.proteas-newsletter-message {
    margin-top: 10px;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.proteas-newsletter-message:empty {
    display: none;
}

.proteas-newsletter-message.is-success {
    padding: 8px 12px;
    background: rgba(39, 174, 96, 0.2);
    color: #fff;
    border-left: 3px solid var(--proteas-nl-success);
}

.proteas-newsletter-message.is-error {
    padding: 8px 12px;
    background: rgba(231, 76, 60, 0.2);
    color: #fff;
    border-left: 3px solid var(--proteas-nl-error);
}

/* ============================================
   Screen Reader Only
   ============================================ */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ============================================
   Responsive Design - Tablet
   ============================================ */
@media screen and (max-width: 960px) {
    .proteas-newsletter-section {
        padding: 25px 30px 20px;
    }

    .proteas-newsletter-container {
        flex-wrap: wrap;
        gap: 20px;
    }

    .proteas-newsletter-branding {
        flex: 0 0 auto;
    }

    .proteas-newsletter-content {
        flex: 1 1 250px;
        padding: 0;
    }

    .proteas-newsletter-form {
        flex: 0 0 auto;
    }

    .proteas-newsletter-input {
        width: 160px;
    }
}

/* ============================================
   Responsive Design - Mobile
   ============================================ */
@media screen and (max-width: 768px) {
    .proteas-newsletter-section {
        padding: 25px 20px 20px;
    }

    .proteas-newsletter-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .proteas-newsletter-branding {
        flex-direction: column;
        gap: 10px;
    }

    .proteas-newsletter-icon svg {
        width: 40px;
        height: 40px;
    }

    .proteas-newsletter-title {
        white-space: normal;
        text-align: center;
    }

    .proteas-newsletter-content {
        padding: 0;
    }

    .proteas-newsletter-description {
        font-size: 0.9rem;
    }

    .proteas-newsletter-form {
        width: 100%;
        max-width: 300px;
    }

    .proteas-newsletter-form-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .proteas-newsletter-fields {
        width: 100%;
    }

    .proteas-newsletter-input {
        width: 100%;
    }

    .proteas-newsletter-button {
        width: 100%;
        padding: 12px 20px;
        margin-top: 5px;
    }

    .proteas-newsletter-privacy {
        margin-top: 15px;
    }

    .proteas-newsletter-privacy p {
        font-size: 0.7rem;
    }
}

/* ============================================
   Very Small Screens
   ============================================ */
@media screen and (max-width: 400px) {
    .proteas-newsletter-section {
        padding: 20px 15px;
    }

    .proteas-newsletter-icon svg {
        width: 35px;
        height: 35px;
    }

    .proteas-newsletter-title {
        font-size: 1rem;
    }

    .proteas-newsletter-description {
        font-size: 0.85rem;
    }
}

/* ============================================
   Accessibility: Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .proteas-newsletter-button,
    .proteas-newsletter-input,
    .proteas-newsletter-message,
    .proteas-newsletter-privacy a {
        transition: none;
    }

    .proteas-newsletter-spinner {
        animation: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .proteas-newsletter-section {
        display: none;
    }
}
