:root {
    --COLOR_BORDER: #4139B2;
    --COLOR_BACKGROUND: #E0E0F2;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    padding: 0;
    margin: 0;
}

body {
    font-family: "Noto Sans JP", serif;
    line-height: 1.5;
    height: 100%;
}

img {
    height: auto;
    max-width: 100%;
}

em {
    color: #FC0048;
    font-style: normal;
    font-weight: bold;
}

button,
input,
select,
textarea {
    margin: 0;
    font-family: inherit;
    font-size: 100%;
}

button,
input {
    overflow: visible;
}

button,
select {
    text-transform: none;
}

select, input, textarea {
    appearance: none;
    border-radius: 0;
    color: inherit;
    font-size: 1rem;
    text-transform: none;
    line-height: inherit;
    max-width: 100%;
}

input[type="radio"] {
    appearance: auto;
}

button, select, input[type="radio"], label {
    cursor: pointer;
}

button:disabled {
    cursor: auto;
}

/*------------------ l-wrap ------------------*/
.l-wrap {
    display: grid;
    grid-template-areas:
        "header"
        "mv"
        "main"
        "footer"
    ;
}

@media (768px <= width) {
    .l-wrap {
        grid-template-areas:
            "header mv"
            "header main"
            "header footer"
        ;
        grid-template-columns: 340px 1fr;
    }
}

/*------------------ l-header ------------------*/
.l-header {
    grid-area: header;

    position: -webkit-sticky; /* Safari用の記述 */
    position: sticky;
    top: 0;
    z-index: 10; /* 他に重なる要素より手前に表示させる */
    background: #fff; /* 背景色を指定しないと、下のコンテンツが透けてしまうため */
}

@media (545px <= width) {
    .l-header {
        display: grid;
        grid-template-columns: repeat(2, auto);
        grid-template-rows: repeat(2, auto);
    }
}

@media (768px <= width) {
    .l-header {
        display: block;
        position: static; /* stickyを解除 */
        background: transparent; /* 指定した背景色をリセット */
    }
}

.l-header__logo {
    max-width: 154px;
}

.l-header__head {
    align-items: center;
    display: grid;
    column-gap: 6px;
    grid-template-columns: min-content 1fr;
    grid-template-rows: repeat(2, auto);
    padding: 8px;
}

@media (545px <= width) {
    .l-header__head {
        display: flex;
        align-items: center;
        justify-content: center;
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
}

.l-header__lead {
    background-color: var(--COLOR_BACKGROUND);
    color: #4139B1;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    display: none;
}

@media (545px <= width) {
    .l-header__lead {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }
}

@media (768px <= width) {
    .l-header__lead {
        display: none;
    }
}

.l-header__body,
.l-header__body .l-header__lead {
    display: none;
}

@media (545px <= width) {
    .l-header__body {
        background: linear-gradient(92.4deg, #6948FE -1.63%, #3A34DC 97.33%);
        display: block;
        grid-column: 1 / 3;
        grid-row: 2 / 3;
        padding: 8px 18px;
    }
}

@media (768px <= width) {
    .l-header__body {
        height: calc(100% + 58px);
    }

    .l-header__body .l-header__lead {
        color: #fff;
        background-color: transparent;
        display: none;
        font-size: 1.3125rem;
        white-space: nowrap;
        text-align: center;
    }
}

.fv {
    grid-area: mv;
    width: 100%;
}
.fv img {
    vertical-align: bottom;
}

/*------------------ l-main ------------------*/
.l-main {
    background-color: #F1F0FF;
    display: grid;
    gap: 0 16px;
    grid-template-columns: 1fr minmax(325px, 850px) 1fr;
    grid-area: main;
    /* overflow: auto; */
    max-height: none;
    padding: 20px 0;
}

@media (768px <= width) {
    .l-main {
        
    }
}

.l-main__inner {
    grid-column: 2 / 3;
    padding-bottom: 100px;
}

/*------------------ l-form ------------------*/
.l-form > :first-child {
    margin-top: 0;
}

/*------------------ l-footer ------------------*/
.l-footer {
    background-color: #fff;
    border-top: 1px solid #9A9A9A;
    grid-area: footer;
    padding: 10px 0 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

@media (768px <= width) {
    .l-footer {
        position: fixed;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: calc(100% - 340px);
    }
}

.l-footer__copyright {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 0px;
}
.l-footer__privacy {
  font-size: 10px;
  text-align: center;
  font-weight: bold;
  color: #0057aa;
}
.l-footer__privacy a {
    text-decoration: none;
}

/*------------------ l-progressBar__meter ------------------*/
.l-progressBar {
    align-items: baseline;
    display: grid;
    gap: 8px;
    grid-template-columns: auto 1fr;
    margin-inline: auto;
    max-width: 330px;
}

.l-progressBar__text {
    font-size: 0.75rem;
}

.l-progressBar__number {
    font-size: 1.125rem;
    margin-inline: 2px;
}

.l-progressBar__meter {
    --progress: 0%;

    background-color: #D4D4D4;
    border: 1px solid var(--COLOR_BORDER);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    height: 20px;
    width: 100%;
}

.l-progressBar__meter::before {
    background: linear-gradient(90deg, #6948FE 0%, #3A34DC 100%);
    content: "";
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--progress);
}


/*------------------ m-box ------------------*/
.m-box-outline,
.m-box-agent {
    border-radius: 4px;
}

.m-box-outline {
    border: 1px solid var(--COLOR_BORDER);
    font-size: 11px;
    padding: 8px;
    color: var(--COLOR_BORDER);
    font-weight: bold;
}

.m-box-outline p:nth-child(2) {
    color: #FC0048;
}

@media (545px <= width) {
    .m-box-outline {
        display: none;
    }
}

.m-box-agent {
    background-color: #fff;
    padding: 12px 24px;
}

@media (545px <= width) {
    .m-box-agent {
        display: flex;
        flex-direction: column;
    }

    .m-box-agent::after {
        background-color: #4139B1;
        content: "";
        display: block;
        order: 2;
        height: 1px;
        width: 100%;
    }

    .m-box-agent__head {
        align-items: center;
        display: flex;
        gap: 4px;
        order: 1;
        padding-bottom: 6px;
    }

    .m-box-agent__body {
        color: #292598;
        display: flex;
        flex-direction: column;
        gap: 5px;
        order: 3;
        padding-top: 10px;
    }

    .m-box-agent__lead {
        font-size: 0.9rem;
    }

    .m-box-agent__lead em {
        font-size: 1rem;
    }

    .m-box-agent__text {
        font-size: 0.75rem;
    }
}

@media (640px <= width) {
    .m-box-agent {
        align-items: center;
        flex-direction: row;
        gap: 24px;
    }

    .m-box-agent::after {
        height: 84px;
        width: 1px;
    }

    .m-box-agent__head {
        display: block;
        text-align: center;
        padding-bottom: 0;
    }

    .m-box-agent__body {
        padding-top: 0;
    }
}

@media (768px <= width) {
    .m-box-agent {
        flex-direction: column;
        gap: 0;
    }

    .m-box-agent::after {
        height: 1px;
        width: 100%;
    }

    .m-box-agent__head {
        display: flex;
        flex-direction: column;
        gap: 11px;
        padding-bottom: 20px;
    }

    .m-box-agent__body {
        padding-top: 18px;
    }

    .m-box-agent__lead {
        font-size: 1rem;
    }

    .m-box-agent__lead em {
        font-size: 1.25rem;
    }

    .m-box-agent__lead strong {
        font-size: 1.125rem;
    }

    .m-box-agent__text {
        font-size: 0.9375rem;
    }
}

/*------------------ m-chat ------------------*/
.m-chat {
    display: grid;
    column-gap: 12px;
    margin-top: 16px;
}

.m-chat.m-chat--other {
    grid-template-columns: auto 1fr;
}

.m-chat.m-chat--self {
    grid-template-columns: 1fr auto;
}

.m-chat.m-chat--self + .m-chat.m-chat--other {
    margin-top: 48px;
}

.m-chat__avatar {
    border-radius: 100rem;
}

.m-chat--other .m-chat__avatar {
    order: 1;
}

.m-chat__message {
    background-color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 16px 20px;
    height: fit-content;
    width: fit-content;
}

.m-chat__message:not(:has(.invalid)) .m-form-error {
    display: none;
}

.m-chat__message:has(.loading) {
    padding: 16px 40px;
}

.m-chat--other .m-chat__message {
    border-radius: 0 16px 16px 16px;
    order: 2;
}

.m-chat--self .m-chat__message {
    color: #fff;
    background: linear-gradient(92.4deg, #6948FE -1.63%, #3A34DC 97.33%);
    border-radius: 16px 0 16px 16px;
    margin-left: auto;  
}

@media (545px <= width) {
    .m-chat__message {
        min-width: 290px;
    }
}

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

.m-chat__message .loading {
    aspect-ratio: 1;
    animation: l5 1s infinite linear alternate;
    border-radius: 50%;
    margin: auto;
    width: 10px;
}
@keyframes l5 {
    0%  {box-shadow: 20px 0 #000, -20px 0 #0002;background: #000 }
    33% {box-shadow: 20px 0 #000, -20px 0 #0002;background: #0002}
    66% {box-shadow: 20px 0 #0002,-20px 0 #000; background: #0002}
    100%{box-shadow: 20px 0 #0002,-20px 0 #000; background: #000 }
}

.m-dialog {
    align-items: center;
    background-color: initial;
    border: 0;
    display: none;
    height: 100%;
    justify-content: center;
    left: 0;
    max-height: 100%;
    max-width: 100%;
    padding: clamp(1.5rem,1.5rem + (1vw - .5625rem) * (15.4545454545),10rem);
    position: fixed;
    top: 0;
    transition: opacity .3s;
    width: 100%
}

.m-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.m-dialog[open] {
    display: flex;
}

.m-dialog__loader {
    aspect-ratio: 1;
    background: #4139B1;
    border-radius: 50%;
    color: transparent;
    padding: 8px;
    user-select: none;
    width: fit-content;
    --_m:
        conic-gradient(#0000 10%,#000),
        linear-gradient(#000 0 0) content-box;
    -webkit-mask: var(--_m);
            mask: var(--_m);
    -webkit-mask-composite: source-out;
            mask-composite: subtract;
    animation: l3 1s infinite linear;
}
@keyframes l3 {to{transform: rotate(1turn)}}

/*------------------ m-select ------------------*/
.m-select {
    border-radius: 4px;
    background-image: url("/chatLP/assets/images/arrow.svg");
    background-repeat: no-repeat;
    background-size: 12px auto;
    background-position: right 12px center;
    color: #000;
    font-family: "Noto Sans JP", serif;
    font-weight: bold;
    padding: 10px 32px 10px 16px;
    position: relative;
    width: 100%;
}

/*------------------ m-button ------------------*/
.m-button {
    color: #4139B1;
    border: 1px solid #4139B1;
    background-color: #fff;
    border-radius: 4px;
    display: block;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px;
    margin-top: 24px;
    margin-inline: auto;
    min-width: 186px;
    width: fit-content;
}

.m-button:disabled {
    color: #fff;
    background-color: #D0D0D0;
    border: 1px solid #A6A6A6;
}

.m-button--entry {
    background: linear-gradient(270deg, #EE3939 0%, #FF7512 100%);
    box-shadow: 0px 3px 0px #9A1D11;
    border-radius: 100rem;
    border: none;
    color: #fff;
}


/*------------------ m-form-birthDay ------------------*/
.m-form-birthDay {
    display: flex;
    gap: 5px;
}

.m-form-birthDay .m-select {
    min-width: 84px;
    width: fit-content;
}

/*------------------ m-form-radio ------------------*/
.m-form-radio {
    display: flex;
    gap: 16px;
}

.m-form-radio__item {
    display: flex;
    gap: 8px;
}

/*------------------ m-form-input ------------------*/
.m-form-input {
    border: none;
    border-radius: 4px;
    color: #000;
    font-family: "Noto Sans JP", serif;
    padding: 10px 8px;
    width: 100%;
}

.m-form-input.invalid {
    border: 2px solid #9A1D11;
}

/*------------------ m-form-name ------------------*/
.m-form-name {
    display: flex;
    gap: 6px;
}

/*------------------ m-form-tel ------------------*/
.m-form-tel {
    align-items: center;
    display: flex;
    gap: 3px;
}

.m-form-tel::before,
.m-form-tel::after {
    background-color: #fff;
    content: "";
    display: block;
    height: 2px;
    min-width: 8px;
}

.m-form-tel::before {
    order: 2;
}

.m-form-tel::after {
    order: 4;
}

.m-form-tel .m-form-input {
    max-width: 73px;
}

.m-form-tel .m-form-input:first-child {
    order: 1;
}

.m-form-tel .m-form-input:nth-child(2) {
    order: 3;
}

.m-form-tel .m-form-input:last-child {
    order: 5;
}

/*------------------ m-form-error ------------------*/
.m-form-error {
    display: inline-block;
    margin-top: 6px;
}