@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@100;200;300;400;500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

:root {
    --color-orange: #ff7326;
    --color-light-cream: #fffaf5;
    --color-light-orange: #fff2eb;
    --color-light-orange2: #ffddca;
    --color-light-blue: #add8f0;
    --color-brown: #381510;
}

html * {
    box-sizing: border-box;
}

html, body {
    font-size: 16px;
    background-color: var(--color-light-cream);
}

body > div {
    font-family: "IBM Plex Sans Thai", sans-serif;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

h1, h2, h3, h4, h5, h6, p1, p2 {
    display: block;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Plus Jakarta Sans", sans-serif;
}

h1 {
    font-size: 2rem;
    line-height: 1.4;
}

h2 {
    font-size: 1.75rem;
    line-height: 1.4;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.4;
}

h4 {
    font-size: 1.25rem;
    line-height: 1.4;
}

h5, p1 {
    font-size: 1rem;
    line-height: 1.4;
}

h6, p2 {
    font-size: 0.75rem;
    line-height: 1.4;
}

a, a:hover, a:focus, a:visited {
    text-decoration: unset;
    color: unset;
}

/* ------------------------------------------------------------------------------------------- */
/* layout */
/* ------------------------------------------------------------------------------------------- */

.gmf-card {
    border-radius: 8px;
    background-color: white;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--color-light-orange);
}

.gmf-flex {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gmf-hr {
    width: 100%;
    height: 1px;
    background-color: #eeeeee;
    margin: 8px 0;
}

.gmf-popup {
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(0.8px);
    z-index: 10000;
}

.gmf-popup > div {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 8px;
    padding: 16px;
    width: 400px;
    max-width: calc(100% - 40px);
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    border: 1px solid #888888;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ------------------------------------------------------------------------------------------- */
/* input */
/* ------------------------------------------------------------------------------------------- */

.gmf-input,
.gmf-dropdown > input {
    border-radius: 4px;
    border: 1px solid #dddddd;
    padding: 4px 8px;
    font-family: "IBM Plex Sans Thai", sans-serif;
    font-size: 16px;
    width: 100%;
    display: block;
    transition: all 400ms;
}

.gmf-input:focus,
.gmf-dropdown > input:focus {
    border-color: var(--color-orange);
}

.gmf-dropdown {
    position: relative;
}

.gmf-dropdown::before {
    content: "\f107";
    font-family: 'Line Awesome Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    color: #dddddd;
    transition: all 400ms;
}

.gmf-dropdown:focus-within::before {
    color: var(--color-orange);
    transform: translateY(-50%) rotate(180deg);
}

.gmf-dropdown > div {
    position: absolute;
    top: 100%;
    left: 0;
    max-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 4px;
    transition: max-height 400ms;
    z-index: 1;
}

.gmf-dropdown:focus-within > div {
    max-height: 160px;
    border: 1px solid #dddddd;
}

.gmf-dropdown > div > div {
    background-color: white;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 400ms;
}

.gmf-dropdown > div > div:hover {
    background-color: var(--color-light-orange);
}

:focus-visible {
    outline: none;
}

.gmf-radio input[type="radio"] {
    display: none;
}

.gmf-radio > label {
    cursor: pointer;
}

.gmf-radio > label > div {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 1px solid #bbbbbb;
    border-radius: 100%;
    content: "";
    vertical-align: middle;
    margin-top: -2px;
    margin-right: 0.5rem;
}

.gmf-radio input[type="radio"]:checked + label > div {
    border-color: var(--color-orange);
    background-color: var(--color-orange);
    background-clip: content-box;
    padding: 4px;
}

/* ------------------------------------------------------------------------------------------- */
/* button */
/* ------------------------------------------------------------------------------------------- */

.gmf-btn {
    background-color: white;
    padding: 4px 8px;
    display: flex;
    gap: 8px;
    border-radius: 4px;
    align-items: center;
    color: #bbbbbb;
    border: 1px solid #bbbbbb;
    cursor: pointer;
    justify-content: center;
    min-width: 72px;
}

.gmf-btn-small {
    width: fit-content;
    gap: 4px;
    font-size: 12px;
}

.gmf-btn-large {
    padding: 8px;
    border-radius: 8px;
}

.gmf-btn:hover {
    filter: brightness(0.96);
}

.gmf-btn-orange {
    color: white;
    background-color: var(--color-orange);
    border: 1px solid var(--color-orange);
}

.gmf-btn-brown {
    color: white;
    background-color: var(--color-brown);
    border: 1px solid var(--color-brown);
}

.gmf-btn-outline-orange {
    color: var(--color-orange);
    border: 1px solid var(--color-orange);
}

.gmf-btn-outline-brown {
    color: var(--color-brown);
    border: 1px solid var(--color-brown);
}


/* ------------------------------------------------------------------------------------------- */
/* loader */
/* ------------------------------------------------------------------------------------------- */

.loader {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
}

.loader-backdrop {
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(0.8px);
    z-index: 10000;
}

.loader-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
}

.calculating-img {
    width: 72px;
    animation: shake 1s;
    animation-iteration-count: infinite;
}

.calculating-text {
    color: white;
    text-align: center;
    font-size: 12px;
}
    
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}