/* Global Variables */
:root {
    --theme-transition: .2s ease;
    --colors-blue-700: #36384D;
    --colors-blue-800: #242742;
    --colors-grey: #949494;
    --colors-red: #FF6155;
    --colors-red-100: #FFE7E6;
    --colors-white: #FFF;
    --spacing-xxs: 0.125rem;
    --spacing-050: 0.25rem;
    --spacing-075: 0.375rem;
    --spacing-100: 0.5rem;
    --spacing-125: 0.625rem;
    --spacing-150: 0.75rem;
    --spacing-200: 1rem;
    --spacing-250: 1.25rem;
    --spacing-300: 1.5rem;
    --spacing-400: 2rem;
    --spacing-500: 2.5rem;
    --spacing-600: 3rem;
    --spacing-800: 4rem;
    --spacing-900: 4.5rem;
    --spacing-1000: 5rem;
    --spacing-1100: 5.5rem;
    --corner-radius-6: 0.375rem;
    --corner-radius-8: 0.5rem;
    --corner-radius-10: 0.625rem;
    --corner-radius-12: 0.75rem;
    --corner-radius-20: 1.25rem;
    --corner-radius-full: 62.4375rem;
    --radius-full: 9999px;
}

/* Global Styles */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

button {
    cursor: pointer;
    font-family: inherit;
}

button,
input {
    font: inherit;
}

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--colors-grey);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .main-container.success,
    .content,
    .branding,
    .thank-you-message,
    .btn-primary,
    .btn-thank-you,
    input[type="email"] {
        transition: none;
    }
}

/* Desktop Default Styles */
/* 1440px Design */

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto/Roboto-Regular.ttf') format('truetype');
    font-style: normal;
    font-weight: 100 400;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto/Roboto-Bold.ttf') format('truetype');
    font-style: normal;
    font-weight: 600 900;
}

body {
    font-family: "Roboto";
    font-feature-settings: 'liga' off, 'clig' off;
    background: var(--colors-blue-700);
}

.newsletter-sign-up {
    display: flex;
    width: min(90rem, 100%);
    height: 100vh;
    justify-content: center;
    align-items: center;
    margin: 0px auto;
}

.main-container {
    position: relative;
    display: flex;
    width: 56.5rem;
    height: 40.0625rem;
    padding: var(--spacing-400);
    justify-content: center;
    align-items: center;
    gap: var(--spacing-800);
    border-radius: 2.25rem;
    background: var(--colors-white);
    box-shadow: 0 15px 60px 0 rgba(0, 0, 0, 0.25);
    margin: 0px auto;
}

.content {
    display: flex;
    flex: 1;
}

form {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--spacing-400);
}

form h1 {
    align-self: stretch;
    color: var(--colors-blue-800);
    font-size: 3.5rem;
    font-style: normal;
    font-weight: 700;
    line-height: 100%;
    margin: 0;
}

form p {
    align-self: stretch;
    color: var(--colors-blue-800);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    margin: 0;
}

.features-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-100);
    color: var(--colors-blue-800);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    list-style: none; 
    padding-left: 0;
    margin: 0;
}

.features-list li {
    position: relative;
    padding-left: 2.25rem; 
}

.features-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.3125rem;
    height: 1.3125rem;
    background-image: url('../images/icon-list.svg');
    background-size: contain;
    background-repeat: no-repeat; 
}

.email {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-100, 0.5rem);
    align-self: stretch;
}

.label-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    align-self: stretch;
}

.label-block label {
    color: var(--colors-blue-800);
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 700;
    line-height: 150%; 
}

.label-block span {
    color: var(--colors-red);
    text-align: right;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 700;
    line-height: 150%; 
}

input[type="email"] {
    display: flex;
    height: 3.5rem;
    padding: var(--spacing-200) var(--spacing-300);
    align-self: stretch;
    border-radius: 0.5rem;
    border: 1px solid var(--colors-grey);
    color: var(--colors-blue-800);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    transition: background var(--theme-transition), border var(--theme-transition);
}

input[type="email"].error {
    border-color: var(--colors-red);
    background: var(--colors-red-100);
}

input[type="email"]::placeholder {
    color: var(--colors-grey);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
}

input[type="email"].error::placeholder {
    color: var(--colors-red);
}

input[type="email"]:hover,
input[type="email"]:focus {
    border-color: var(--colors-blue-800);
    outline: none;
}

input[type="email"].error:hover,
input[type="email"].error:focus {
    border-color: var(--colors-red);
}

.btn-primary {
    position: relative;
    display: flex;
    padding: var(--spacing-200) 0;
    justify-content: space-between;
    align-items: center;
    align-self: stretch;
    border-radius: var(--corner-radius-8);
    background: var(--colors-blue-800);
    color: var(--colors-white);
    text-align: center;
    font-size: 1rem;
    font-style: normal;
    font-weight: 700;
    line-height: 150%;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    border: none;
}

.btn-primary span {
    position: relative;
    width:100%;
    text-align: center;
    z-index: 1;
}

.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        #FF6A3A 0%,
        #FF527B 100%
    );
    opacity: 0;
    transition: opacity var(--theme-transition);
    z-index: -1;
}

.btn-primary:hover::before {
    opacity: 1;
}

.branding {
    display: flex;
    flex: 1;
}

.image-container {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    overflow: hidden;
}

.image-container img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block; 
}

.main-container.success {
    width: 31.5rem;
    height: 33.25rem;
    padding: var(--spacing-800);
    align-items: flex-start;
}

.thank-you-message {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--spacing-400);
}

.check svg {
    width: 4rem;
    height: 4rem;
}

.thank-you-message h2 {
    align-self: stretch;
    color: var(--colors-blue-800);
    font-size: 3.5rem;
    font-style: normal;
    font-weight: 700;
    line-height: 100%;
    margin: 0;
}

.thank-you-message p {
    color: var(--colors-blue-800);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    margin: 0;
}

.subscriber-email {
    font-weight: 700;
}

.btn-thank-you {
    box-shadow: none;
    transition: box-shadow var(--theme-transition);
}

.btn-thank-you:hover {
    box-shadow: 0 16px 32px 0 rgba(255, 97, 85, 0.50);
}

.nowrap {
    white-space: nowrap;
}

/* Transitions */

.main-container.success {
    transition:
    width 0.4s ease,
    height 0.4s ease,
    gap 0.4s ease,
    padding 0.4s ease;
}

.main-container.success .content,
.main-container.success .branding {
    display: none;
}

.content,
.branding {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.thank-you-message {
    opacity: 0;
}

.thank-you-message.visible {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    flex: 0 0 0;
}

.hidden {
    display: none;
}

/* Small Desktop / Large Tablet */

@media (max-width: 992px) {
    .newsletter-sign-up {
        width: min(48rem, 100%);
        padding: 4.5625rem 5rem;
    }
    
    .main-container {
        width: 38rem;
        height: 54.875rem;
        flex-direction: column;
        padding: var(--spacing-500);
        gap: var(--spacing-500);
    }
    
    .content {
        width:100%;
        order: 2;
    }
    
    form {
       gap: var(--spacing-300); 
    }
    
    .branding {
        width:100%;
        order: 1;
    }
}

@media (max-width: 768px) {
    main {
        flex: 1;
    }
    
    .main-container {
        width: 26.4375rem;
        height: 52.625rem;
        padding: var(--spacing-400);
    }
    
    .main-container.success {
        width: 26.4375rem;
        height: 32.5rem;
        padding: var(--spacing-400);
    }
}

/* Mobile */

@media (max-width: 576px) {
    body {
        background: var(--colors-white);
    }
    
    .newsletter-sign-up {
        width: 100%;
        height: auto;
        padding: 0;
    }
    
    .main-container {
        width: 100%;
        height: auto;
        padding: 0 0 var(--spacing-400) 0;
        box-shadow: none;
    }
    
    .main-container.success {
        width: 100%;
        height: 52.625rem;
        padding: var(--spacing-400);
    }
    
    .content {
        width: 100%;
        padding: 0 var(--spacing-400);
    }
    
    .branding {
        width: 100%;
    }
    
    .image-container {
        border-radius: 0 0 1rem 1rem;
    }
    
    .thank-you-message {
        position: relative;
        height: 100%;
        flex: 1;
        margin-top: 7rem;
        justify-content: initial;
    }
    
    .btn-thank-you {
        position: absolute;
        bottom: 0;
        width: 100%;
    }
}

