/**
---------------------------------------------------------------
        
            ✧ ｉｓｅｃ ｍａｉｌｃｈｉｍｐ ｓｉｇｎｕｐ ✧          
                
---------------------------------------------------------------

    author:     lauren shutt
    website:    laurenshutt.dev
    email:      hello@laurenshutt.dev
    updated:    october 2025

    custom signup form for mailchimp using mailchimp's api. 

    features:
    * checks on email field blur whether the email address
      already exists in the audience databse.
    * values for selected interest chips are added to the 
      contact as tags.
    * url parameters are parsed and added as merge fields for 
      source, medium, and campaign.
    * custom recaptcha v3 for funsies.

    © 2025 lauren shutt
    do not use, copy, or modify without explicit permission.

---------------------------------------------------------------
**/



/**
------------------------------------------------- 
        
    ✧ ｖａｒｉａｂｌｅｓ ✧          
                
-------------------------------------------------
**/

:root {
    --isec-red: #990000;
    line-height:1.2;
}


/**
------------------------------------------------- 
        
    ✧ ｇｌｏｂａｌ ✧          
                
-------------------------------------------------
**/

html {
    overscroll-behavior: none;
}
body {
    font-family:'Amiri', serif;
    font-size:18px;
    margin:0;
    background-image: linear-gradient(to bottom, rgba(157,119,51,0) 0px, rgba(157,119,51,1) 88%), url(https://isec.catholic.edu/wp-content/uploads/theme-files/img/gold-5.png);
    background-attachment:fixed;
    box-sizing: boder-box;
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Amiri', serif;
    line-height:1.2;
    margin:0;
    font-weight:normal;
}
h1 {
    text-align:center;
    margin-bottom:5px;
    font-size:41px;
}
h2 {
    margin-bottom:10px;
}
h1 br {
    display:none;
}
p {
    margin:0;
    margin-bottom:15px;
}


/**
------------------------------------------------- 
        
            ✧ ｆｏｒｍ ｗｒａｐｐｅｒｓ ✧          
                
-------------------------------------------------
**/

#form-wrapper {
    background: url(https://isec.catholic.edu/wp-content/uploads/theme-files/img/white-marble.png) center top / contain no-repeat, 
        linear-gradient(to top, #eae1e5, white 40%), bottom;
    max-width:800px;
    display:block;
    margin:20px auto;
    padding:45px;
    margin:75px auto;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, 
        rgba(0, 0, 0, 0.22) 0px 15px 12px;
    box-sizing:border-box;
    border-radius:8px;
}
#form-wrapper > img {
    margin:0 10px; 
    margin-bottom:35px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    max-width:320px;
    width:auto;
    margin-top:10px;
}
#form-wrapper > p {
    text-align:center;
    font-size:20px;
    margin-bottom:50px;
}
#required-wrapper, #chips-wrapper {
    padding:0 20px;
}
#required-wrapper > div, #optional-wrapper > div {
    margin-top:28px;
    position:relative;
}
#interests-wrapper > p {
    margin-bottom:40px;
}
#required-wrapper {
    margin-bottom:50px;
}
#interests-wrapper {
    margin-bottom:60px;
}
details {
    padding:0 25px;
}
summary { 
    list-style: none;              
    position: relative;            
    padding-left: 24px;
    left:-25px;
    cursor:pointer;

}
summary::-webkit-details-marker { display: none; }  
summary::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 24px;
    height: 24px;
    margin-top:-1px;
    transform: translateY(-50%) rotate(0deg);
    transition: transform .25s ease;
    background-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%20192%20512%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M0%20384.662V127.338c0-17.818%2021.543-26.741%2034.142-14.142l128.662%20128.662c7.81%207.81%207.81%2020.474%200%2028.284L34.142%20398.804C21.543%20411.404%200%20402.48%200%20384.662z%27/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 80% 80%; /* square fit so rotation doesn’t change size */
}
details[open] summary::before {
    transform: translateY(-50%) rotate(90deg);
}
.whats-this{
    margin-left: 4px;
    background: #cab3bd;
    color: white;
    font-size: 11px;
    padding: 4px 6px;
    padding-right:8px;
    display: inline-flex;
    align-items: center;
    border-radius: 3px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
    margin-top:-2.5px;
    position:relative;
    cursor:pointer;
}

.whats-this:before,
.whats-this::before {
    content: "\24D8";                  /* ⓘ */
    display: inline-block;
    font-size:14px;
    line-height: 1; 
    font-family: "Segoe UI Symbol","Apple Symbols","Noto Sans Symbols 2",system-ui,sans-serif;
    color: currentColor;
    margin-right: 4px;
    transform: translateY(2.5px);
  }




/**
------------------------------------------------- 
        
                    ✧ ｉｎｐｕｔｓ ✧          
                
-------------------------------------------------
**/

input[type="text"], input[type="email"] {
    background-color: #f9f9f9;;
    border: none;
    border-radius: 4px;
    outline: none;
    height: 2.75rem;
    width: 100%;
    margin: 0 0 8px 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    box-shadow: inset 1px 1px 4px rgba(0, 0, 0, .15), 
        inset 1px 2px 6px rgba(0, 0, 0, .15);
    -webkit-transition: border .3s, -webkit-box-shadow .3s;
    transition: border .3s, -webkit-box-shadow .3s;
    transition: box-shadow .3s, border .3s;
    transition: box-shadow .3s, border .3s, -webkit-box-shadow .3s;
    padding-left:10px;
    font-size: 17px;
}
input[type="text"]:disabled, input[type="email"]:disabled {
    color: rgba(0, 0, 0, 0.42);
    border-bottom: 1px dotted rgba(0, 0, 0, 0.42);
}
label {
    color: #9e9e9e;
    position: absolute;
    top: 0;
    left: 0;
    cursor: text;
    font-family: "Open Sans", sans-serif;
    font-size:16px;
    -webkit-transition: color .2s ease-out, 
        -webkit-transform .2s ease-out;
    transition: color .2s ease-out, 
        -webkit-transform .2s ease-out;
    transition: transform .2s ease-out, 
        color .2s ease-out;
    transition: transform .2s ease-out, 
        color .2s ease-out, 
        -webkit-transform .2s ease-out;
    -webkit-transform-origin: 0% 100%;
    transform-origin: 0% 100%;
    text-align: initial;
    -webkit-transform: translateY(14px);
    transform: translateY(13px);
    margin-left:10px;
    font-weight: 400;
}
input:focus ~ label, input.has-text ~ label {
    -webkit-transform: translateY(-8px) scale(0.8);
    transform: translateY(-8px) scale(0.8);
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    background:white;
    padding:0 5px;
}
input[type="text"]:focus, input[type="email"]:focus {
    border: 1px solid #ccc;
    background-color:transparent;
    box-shadow:none;
}
input:focus ~ label {
    color:var(--isec-red);
}
input[type="text"].error, input[type="email"].error {
    border-color:#F44336;
    box-shadow: 0 1px 0 0 #F44336;
}
input[type="text"].error ~ label,  input[type="text"].error ~ .helper-text, input[type="email"].error ~ label, input[type="email"].error ~ .helper-text {
    color: #F44336;
}
.helper-text {
    display:none;
    color: rgba(0, 0, 0, 0.54);
    font-size: 12px;
    font-family:"Open Sans";
}
.spinner {
    position:absolute;
    top:1.125rem !important;
    left:0;
    width:2em;
    visibility:hidden;
}
#measure {
    visibility: hidden;
    white-space: pre;
    font: inherit;
    position:absolute;
}


/** Country list **/

#country ~ ul {
    display:none;
    position: absolute;
    background: white;
    min-width:100px;
    width:fit-content;
    z-index: 1;
    -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
    padding:0;
}
#country ~ ul li {
    list-style-type: none;
    clear: both;
    color: rgba(0, 0, 0, 0.87);
    cursor: pointer;
    min-height: 50px;
    line-height: 1.5rem;
    width: 100%;
    text-align: left;
    display:flex;
    padding-left:14px;
    font-family:"Open Sans", sans-serif;
    font-size:14px;
}
#country li span {
    padding:14px 16px;
    padding-left:0;
}
#country li svg {
    width:2em;
    margin-right:8px;
}



/**
------------------------------------------------- 
        
                    ✧ ｃｈｉｐｓ ✧          
                
-------------------------------------------------
**/

.chip {
    display: inline-block;
    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3R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JGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==);
    height: 32px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.6);
    line-height: 32px;
    padding: 0 12px;
    border-radius: 4px;
    margin-bottom: 13px;
    margin-right: 6px;
    font-family: "Open Sans", 
        serif;
    font-weight:500;
    margin-top: 0;
    cursor: pointer;
    font-size: 14px;
    filter: brightness(1.4);
    text-shadow: 1px 1px 1px hsla(0,0%,255%,0.4);
    background-size:105px;
    position:relative;
    z-index:0;
    transition:filter .33s ease;
    background-color:transparent;
    border:none;
    box-shadow:-3px -4px 5px 2px rgba(0, 0, 0, .05) inset;
}
.chip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgb(222, 198, 155) 0%, 
        rgb(203, 165, 96) 49%, 
        rgb(157, 119, 51) 51%, 
        rgb(193, 148, 66) 100%
    );
    opacity: 0; 
    transition: opacity 0.33s ease;
    pointer-events: none; 
    height:100%;
    width:100%;
    z-index:-1;
    border-radius: 5px;
}
.chip.selected {
    color: white;
    text-shadow:none;
    filter:brightness(1.1);
}
.chip.selected::after {
    opacity:1;
}
.chip.hidden {
    visibility:hidden;
}



@media screen and (max-width:992px){
    h1 {
        font-size:31px;
    }
    h2 {
        font-size:26px;
    }
    h1 br {
        display:block;
    }
    .chip {
        height:28px;
        line-height:28px;
        font-size:12px;
    }
    .chip > img {
        height:28px;
        width:28px;
    }
    .chip span {
        display:none;
    }
}



/**
------------------------------------------------- 
        
                    ✧ ｂｕｔｔｏｎ ✧          
                
-------------------------------------------------
**/

button[type="submit"]{
    background-color: #c89f56;
    box-shadow: 2px 4px 8px 0 rgba(255, 255, 255, 0.3) inset, 
        -3px -3px 10px 0 rgba(0, 0, 0, .25) inset;
    background-image: url("https://isec.catholic.edu/wp-content/uploads/theme-files/img/test.png");
    background-size: cover;
    display:flex;
    flex-direction: row;
    align-items: center;
    height: 3rem;
    padding: 10px 15px;
    padding-right: 22px;
    border: none;
    text-transform: uppercase;
    font-family: "Open Sans", 
        sans-serif;
    letter-spacing: 2px;
    color: white;
    border-radius: 3px;
    line-height: 1;
    text-decoration: none;
    margin-top:40px;
    transition: background-color .2s ease-out;
    cursor: pointer;
    font-size: 15px;
    outline: 0;
}
button[type="submit"]::before {
    content: "";                         
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url(https://trs-web.app/wp-content/uploads/theme-files/img/cross.png) no-repeat center center;
    background-size: contain;
    margin-right:10px;
    margin-top:-1px;
}


/* Tooltip */
.tooltip {
  position: absolute;
  bottom: -25%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #222;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
  text-transform:none;
  width:300px;
  letter-spacing:0px;
  font-size:13px;
  line-height:1.4;
}
.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #222 transparent transparent transparent;
}
.tooltip.show {
  opacity: 1;
}
