/* ============================================================
   Thimze Newsletter — Frontend Signup Form Styles
   assets/css/frontend.css

   Design direction: a wide, flat banner — product image on the
   left, bold heading + lighter subtext + form stacked and centered
   right. No card chrome (no border/shadow on the outer wrapper),
   matching a clean retail-style signup strip.
   ============================================================ */

:root {
    --tnl-accent:        #19c3f3;
    --tnl-accent-dark:   #0fa3d1;
    --tnl-accent-light:  #eefaff;
    --tnl-ink:           #19151a;
    --tnl-grey:          #6b7280;
    --tnl-border:        #d8dadd;
    --tnl-bg:            #f4f4f5;
    --tnl-radius:        8px;
}

.thimze-newsletter-form {
    display: flex;
    align-items: stretch;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px;
    background: var(--tnl-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* ---- Image panel --------------------------------------------------- */

.thimze-newsletter-image {
    flex: 0 0 38%;
    min-width: 0;
    border-radius: var(--tnl-radius);
    overflow: hidden;
    background: #e2e2e4;
}

.thimze-newsletter-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
}

/* ---- Content column ------------------------------------------------ */

.thimze-newsletter-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 24px;
}

.thimze-newsletter-header {
    max-width: 560px;
    margin-bottom: 22px;
}

.thimze-newsletter-header h2 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--tnl-ink);
}

.thimze-newsletter-subtext {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--tnl-grey);
}

/* ---- Form ------------------------------------------------------------ */

.thimze-newsletter-form-body {
    width: 100%;
    max-width: 560px;
}

.thimze-newsletter-form-body .form-group {
    margin-bottom: 16px;
}

.thimze-input-wrap {
    position: relative;
}

.thimze-newsletter-form .thimze-input-wrap svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--tnl-grey);
    pointer-events: none;
    z-index: 1;
}

.thimze-newsletter-form .thimze-input.thimze-input {
    width: 100%;
    padding: 14px 16px 14px 46px !important;
    font-size: 15px;
    color: var(--tnl-ink);
    border: 1.5px solid var(--tnl-border);
    border-radius: var(--tnl-radius);
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.thimze-input::placeholder {
    color: #8a8a8e;
    font-style: italic;
}

.thimze-input:focus {
    outline: none;
    border-color: var(--tnl-accent);
    box-shadow: 0 0 0 3px rgba(25, 195, 243, 0.18);
}

.thimze-newsletter-form-body .form-group.checkbox {
    margin-bottom: 18px;
}

.thimze-newsletter-form-body .form-group.checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    color: var(--tnl-grey);
    cursor: pointer;
    line-height: 1.55;
    text-align: left;
}

.thimze-newsletter-form-body .form-group.checkbox input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--tnl-accent);
    cursor: pointer;
}

.thimze-newsletter-form-body .form-group.checkbox a {
    color: var(--tnl-ink);
    text-decoration: underline;
}

.thimze-button {
    display: block;
    margin: 0 auto;
    min-width: 180px;
    padding: 13px 32px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.thimze-button-primary {
    background: var(--tnl-accent);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(15, 163, 209, 0.45);
}

.thimze-button-primary:hover:not(:disabled) {
    background: var(--tnl-accent-dark);
    box-shadow: 0 8px 18px -6px rgba(15, 163, 209, 0.55);
}

.thimze-button-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.thimze-button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.thimze-button.is-loading {
    position: relative;
    color: transparent !important;
}

.thimze-button.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tnl-spin .7s linear infinite;
}

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

/* ---- Error state ------------------------------------------------- */

.thimze-newsletter-error {
    margin-top: 14px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--tnl-radius);
    animation: tnl-shake 0.3s ease;
}

.thimze-newsletter-error .error-message {
    margin: 0;
    font-size: 13px;
    color: #b91c1c;
}

@keyframes tnl-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    75%      { transform: translateX(3px); }
}

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

.thimze-newsletter-success {
    text-align: center;
    padding: 20px 0;
    animation: tnl-fade-in 0.35s ease;
}

.thimze-newsletter-success .success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    background: var(--tnl-accent-light);
    color: var(--tnl-accent);
    border: 2px solid var(--tnl-accent);
    border-radius: 50%;
    font-size: 22px;
    animation: tnl-stamp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.thimze-newsletter-success h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--tnl-ink);
}

.thimze-newsletter-success p {
    margin: 0;
    font-size: 14px;
    color: var(--tnl-grey);
    line-height: 1.5;
}

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

@keyframes tnl-stamp {
    0%   { transform: scale(1.6); opacity: 0; }
    60%  { transform: scale(0.92); opacity: 1; }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .thimze-newsletter-error,
    .thimze-newsletter-success,
    .thimze-newsletter-success .success-icon {
        animation: none;
    }
}

/* ---- Sidebar variant: compact, no image, left-aligned ------------- */

.thimze-newsletter-form-sidebar {
    flex-direction: column;
    gap: 0;
    max-width: 360px;
    padding: 24px;
    border-radius: var(--tnl-radius);
}

.thimze-newsletter-form-sidebar .thimze-newsletter-content {
    align-items: flex-start;
    text-align: left;
    padding: 0;
}

.thimze-newsletter-form-sidebar .thimze-newsletter-header,
.thimze-newsletter-form-sidebar .thimze-newsletter-form-body {
    max-width: none;
}

.thimze-newsletter-form-sidebar .thimze-newsletter-header h2 {
    font-size: 19px;
}

.thimze-newsletter-form-sidebar .form-group.checkbox label,
.thimze-newsletter-form-sidebar .thimze-newsletter-success {
    text-align: left;
}

.thimze-newsletter-form-sidebar .thimze-button {
    margin: 0;
    width: 100%;
}

/* ---- Responsive ----------------------------------------------------- */

@media (max-width: 800px) {
    .thimze-newsletter-form:not(.thimze-newsletter-form-sidebar) {
        flex-direction: column;
        gap: 24px;
        padding: 20px;
    }

    .thimze-newsletter-image {
        flex: none;
        width: 100%;
    }

    .thimze-newsletter-image img {
        min-height: 200px;
        max-height: 280px;
    }

    .thimze-newsletter-header h2 {
        font-size: 20px;
    }
}
