/* ==========================================================================
   Component: Newsletter Modal
   "Подписка на новости" — email subscription popup
   ========================================================================== */

/* Overlay, backdrop, popup, close — provided by dsb-modal-base.css */

/* --- Navigation (close button) --- */

.newsletter-modal__nav {
    display: flex;
    justify-content: flex-end;
}

/* --- Body --- */

.newsletter-modal__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* --- Header (title + subtitle) --- */

.newsletter-modal__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.newsletter-modal__title {
    font-family: var(--font-family-serif);
    font-size: 28px;
    font-weight: 500;
    line-height: 40px;
    color: var(--color-dark-600);
    margin: 0;
}

.newsletter-modal__subtitle {
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    font-weight: 400;
    line-height: 24px;
    color: var(--color-dark-600);
    margin: 0;
}

/* --- Form --- */

.newsletter-modal__form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* --- Fields --- */

.newsletter-modal__fields {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.newsletter-modal__field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-modal__label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 15px;
    color: var(--color-dark-600);
}

.newsletter-modal__input {
    width: 100%;
    min-height: 48px;
    padding: 14px 16px;
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 18px;
    color: var(--color-dark-600);
    background: var(--color-accent-50);
    border: 1px solid var(--color-accent-200);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s;
}

.newsletter-modal__input::placeholder {
    color: var(--color-dark-400);
}

.newsletter-modal__input:focus {
    border-color: var(--color-accent);
}

.newsletter-modal__input--error {
    border-color: var(--color-red);
}

/* --- Consent checkbox --- */

.newsletter-modal__consent {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.newsletter-modal__checkbox {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--color-accent-600);
    cursor: pointer;
}

.newsletter-modal__consent-text {
    font-size: var(--font-size-base);
    line-height: 18px;
    color: var(--color-dark-500);
}

/* --- Actions (button + hint) --- */

.newsletter-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.newsletter-modal__submit {
    width: 100%;
    padding: 18px 26px;
    font-size: var(--font-size-lg);
    font-weight: 500;
    line-height: 20px;
}

.newsletter-modal__hint {
    font-size: var(--font-size-sm);
    line-height: 17px;
    color: var(--color-dark-400);
    text-align: center;
    margin: 0;
}

/* --- Error message --- */

.newsletter-modal__error {
    font-size: var(--font-size-sm);
    line-height: 17px;
    text-align: center;
    color: var(--color-red);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.newsletter-modal__error--visible {
    max-height: 60px;
    opacity: 1;
}

/* --- Success state --- */

.newsletter-modal__success[hidden] {
    display: none;
}

.newsletter-modal__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.newsletter-modal__success-title {
    font-family: var(--font-family-serif);
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--color-dark-600);
    margin: 0;
}

.newsletter-modal__success-text {
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    color: var(--color-dark-400);
    margin: 0;
}

/* Hide form elements when success is shown */
.newsletter-modal__form--success .newsletter-modal__fields,
.newsletter-modal__form--success .newsletter-modal__consent,
.newsletter-modal__form--success .newsletter-modal__actions,
.newsletter-modal__form--success .newsletter-modal__error {
    display: none;
}

/* ==========================================================================
   RESPONSIVE — 768px (Mobile)
   ========================================================================== */

@media (max-width: 768px) {
    .newsletter-modal__title {
        font-size: 24px;
        line-height: 26px;
    }

    .newsletter-modal__subtitle {
        font-size: var(--font-size-base);
        line-height: 20px;
    }

    .newsletter-modal__submit {
        padding: 15px 18px;
        font-size: var(--font-size-base);
        line-height: 18px;
    }
}
