/* ==========================================================================
   Ammonit Newsletter Popup — Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&display=swap');

/* Overlay */
.amn-nl-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.4s ease;
}

.amn-nl-overlay.amn-nl-visible {
    background: rgba(0, 0, 0, 0.55);
}

/* Modal */
.amn-nl-modal {
    position: relative;
    background: #ffffff;
    border-radius: 4px;
    width: 100%;
    max-width: 440px;
    padding: 44px 40px 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s ease;
}

.amn-nl-overlay.amn-nl-visible .amn-nl-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Close button */
.amn-nl-modal .amn-nl-close,
.amn-nl-modal .amn-nl-close:focus {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    bottom: auto !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    font-size: 26px !important;
    color: #999 !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: color 0.2s ease, background 0.2s ease !important;
    border-radius: 50% !important;
    z-index: 10 !important;
    float: none !important;
    text-align: center !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.amn-nl-modal .amn-nl-close:hover {
    color: #1c1d1c !important;
    background: #f5f5f3 !important;
}

/* Header */
.amn-nl-header {
    text-align: center;
    margin-bottom: 0;
    padding-right: 20px;
    padding-left: 20px;
}

.amn-nl-logo {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.35em;
    color: #a08766;
    margin-bottom: 18px;
    text-transform: uppercase;
}

.amn-nl-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 1.2;
    color: #1c1d1c;
    margin: 0 0 12px;
    letter-spacing: 0.01em;
}

.amn-nl-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #6b6b6b;
    margin: 0;
}

/* Divider */
.amn-nl-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
}

.amn-nl-divider span {
    display: block;
    width: 40px;
    height: 1px;
    background: #a08766;
}

/* Form */
#amnNlForm {
    margin: 0;
    padding: 0;
}

.amn-nl-field {
    margin-bottom: 16px;
}

.amn-nl-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: #1c1d1c;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.amn-nl-input::placeholder {
    color: #aaa;
}

.amn-nl-input:focus {
    border-color: #a08766;
    box-shadow: 0 0 0 3px rgba(160, 135, 102, 0.1);
}

.amn-nl-input.amn-nl-input-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

/* Field error */
.amn-nl-field-error {
    font-size: 12px;
    color: #c0392b;
    margin-top: 6px;
    min-height: 0;
    line-height: 1.4;
}

/* Consent checkbox */
.amn-nl-consent {
    margin-bottom: 20px;
}

.amn-nl-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.amn-nl-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.amn-nl-checkmark {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #c0c0c0;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 1px;
    background: #fff;
}

.amn-nl-checkbox-label input[type="checkbox"]:checked + .amn-nl-checkmark {
    background: #a08766;
    border-color: #a08766;
}

.amn-nl-checkbox-label input[type="checkbox"]:checked + .amn-nl-checkmark::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}

.amn-nl-checkmark.amn-nl-checkmark-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

.amn-nl-consent-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: #777;
}

.amn-nl-consent-text a {
    color: #a08766;
    text-decoration: underline;
    text-decoration-color: rgba(160, 135, 102, 0.3);
    transition: text-decoration-color 0.2s ease;
}

.amn-nl-consent-text a:hover {
    text-decoration-color: #a08766;
}

/* Submit button */
.amn-nl-modal .amn-nl-btn,
.amn-nl-modal .amn-nl-btn:focus,
.amn-nl-modal .amn-nl-btn:visited {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 48px !important;
    padding: 0 24px !important;
    background: #b09c81 !important;
    background-color: #b09c81 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 3px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: background 0.25s ease !important;
    -webkit-appearance: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    margin: 0 !important;
}

.amn-nl-modal .amn-nl-btn:hover {
    background: #9a8770 !important;
    background-color: #9a8770 !important;
    color: #ffffff !important;
}

.amn-nl-modal .amn-nl-btn:active {
    transform: scale(0.98) !important;
}

.amn-nl-modal .amn-nl-btn:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* Button loader spinner */
.amn-nl-btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: amnNlSpin 0.6s linear infinite;
}

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

/* Success state */
.amn-nl-success-wrap {
    text-align: center;
    padding: 10px 0;
}

.amn-nl-success-icon {
    margin-bottom: 20px;
}

.amn-nl-success-icon svg {
    animation: amnNlCheckIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes amnNlCheckIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.amn-nl-success-icon circle {
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: amnNlCircle 0.8s ease forwards 0.2s;
}

@keyframes amnNlCircle {
    to { stroke-dashoffset: 0; }
}

.amn-nl-success-icon path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: amnNlCheck 0.4s ease forwards 0.6s;
}

@keyframes amnNlCheck {
    to { stroke-dashoffset: 0; }
}

.amn-nl-success-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 500;
    font-size: 26px;
    color: #1c1d1c;
    margin: 0 0 10px;
}

.amn-nl-success-text {
    font-size: 14px;
    line-height: 1.6;
    color: #6b6b6b;
    margin: 0 0 24px;
}

/* Closing animation */
.amn-nl-overlay.amn-nl-closing {
    background: rgba(0, 0, 0, 0) !important;
}

.amn-nl-overlay.amn-nl-closing .amn-nl-modal {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
}

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

@media (max-width: 480px) {
    .amn-nl-modal {
        padding: 36px 24px 28px;
        max-width: 100%;
        border-radius: 0;
        min-height: auto;
    }

    .amn-nl-title {
        font-size: 24px;
    }

    .amn-nl-subtitle {
        font-size: 13px;
    }

    .amn-nl-input {
        height: 44px;
        font-size: 16px; /* prevent iOS zoom */
    }

    .amn-nl-btn {
        height: 44px;
    }
}
