:root {
    --primary-color: rgb(0, 161, 167);
    --secondary-color: #ACE0DA;
    --dark-color: rgb(0, 115, 119);
    --light-color: rgba(51, 179, 166, .1);
    --error-color: rgb(156, 0, 0);
    --error-bgcolor: rgb(255, 199, 199);
}

* {
    scrollbar-width: thin;
    scroll-behavior: smooth;
    outline: none;
    font-family: 'Montserrat', sans-serif;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .15);
}

::selection {
    color: white !important;
    background: var(--primary-color) !important;
}

.noselect {
    user-select: none;
}

html {
    background: var(--light-color);
    color: rgba(0, 0, 0, .6);
}

html, body {
    padding: 0;
    margin: 0;
    height: var(--vh, 100vh);
}

body {
    display: flex;
    justify-content: center;
}

a {
    color: var(--primary-color);
}

input[type=text],
input[type=email],
input[type=tel],
input[type=password],
textarea {
    font-size: 100%;
    max-width: calc(100vw - 40px);
    padding: 13px 10px;
    border: none;
    border-radius: 10px;
    color: rgba(0, 0, 0, .6);
}

/* LOGIN */
#loginWrapper {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-color);
}

#loginWrapper label {
    text-align: center;
}

#loginWrapper #login {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* FORM */
main {
    max-width: 800px;
    padding: 50px 20px;
}

@media screen and (max-width: 600px) {
    main {
        padding: 20px;
    }
}

#send {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 30px;
}

html.showPreview #send,
html.showConfirm #send {
    filter: blur(8px);
}

#channelDiv,
#subjectDiv,
#bodyDiv,
#italicDiv,
#footerDiv,
#buttonDiv,
html.channel-voice #toDiv {
    grid-column: 1 / span 2;
}

@media screen and (max-width: 600px) {

    #fromDiv,
    #toDiv,
    #titleDiv,
    #subtitleDiv {
        grid-column: 1 / span 2;
    }
}

#send>div {
    display: flex;
    gap: 10px;
    padding: 10px;
}

#send>div:not(#channelDiv):not(#buttonDiv) {
    flex-direction: column;
}

#send label {
    max-width: calc(100% - 40px);
}

#send #bodyDiv {
    gap: unset;
}

#send #bodyDiv label {
    margin-bottom: 10px;
}

#send .ql-toolbar {
    background-color: white;
    border: none;
    border-radius: 10px 10px 0 0;
}

#send #bodyEmail {
    font-size: 16px;
    border: none;
}

#send #bodyEmail .ql-editor {
    background-color: white;
    border-radius: 0 0 10px 10px;
}

#send #bodyEmail.error .ql-editor.ql-blank {
    background-color: var(--error-bgcolor);
}

#send #bodyEmail .ql-editor::before {
    font-style: normal;
    color: #acacac;
}

#send #bodyEmail.error .ql-editor.ql-blank::before {
    color: #c95a5a;
}

#send #channelDiv {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

#send #channelDiv button {
    font-size: 22px;
    padding: 16px;
    border: none;
    color: var(--primary-color);
    background-color: transparent;
    cursor: pointer;
}

@media screen and (max-width: 600px) {
    #send #channelDiv button {
        font-size: 17px;
    }
}

#send #channelDiv button:hover {
    border-bottom: 3px solid var(--secondary-color);
}

html.channel-sms #send #channelDiv #sms,
html.channel-email #send #channelDiv #email,
html.channel-voice #send #channelDiv #voice {
    border-bottom: 3px solid var(--primary-color);
}

html.channel-sms #toEmail,
html.channel-sms #subjectDiv,
html.channel-sms #titleDiv,
html.channel-sms #subtitleDiv,
html.channel-sms #bodyEmail,
html.channel-sms .ql-toolbar,
html.channel-sms #italicDiv,
html.channel-sms #footerDiv,
html.channel-sms #previewButton,
html.channel-email #toTel,
html.channel-email #bodyTel,
html.channel-voice #fromDiv,
html.channel-voice #toEmail,
html.channel-voice #subjectDiv,
html.channel-voice #titleDiv,
html.channel-voice #subtitleDiv,
html.channel-voice #bodyEmail,
html.channel-voice .ql-toolbar,
html.channel-voice #italicDiv,
html.channel-voice #footerDiv,
html.channel-voice #previewButton {
    display: none !important;
}

#send input {
    max-width: calc(100vw - 80px);
}

#send input.error,
#send textarea.error {
    color: var(--error-color);
    background-color: var(--error-bgcolor);
}

#send textarea {
    min-height: 86px;
    max-height: 400px;
    resize: vertical;
}

#send #buttonDiv {
    justify-content: end;
}

#send #buttonDiv button,
#confirmDialog button {
    display: flex;
    align-items: center;
    font-size: 16px;
    padding: 8px;
    border: none;
    color: white;
    background-color: var(--primary-color);
    border-radius: 10px;
    cursor: pointer;
}

#send #buttonDiv button:hover,
#confirmDialog button:hover {
    background-color: var(--dark-color);
}

#send #buttonDiv button::before,
#confirmDialog button#confirm::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    margin-right: 7px;
    filter: invert(1);
    background-size: 20px 20px;
    background-repeat: no-repeat;
}

#send #buttonDiv button#sendButton::before,
#confirmDialog button#confirm::before {
    background-image: url("/res/send.svg");
}

#send #buttonDiv button#previewButton::before {
    background-image: url("/res/preview.svg");
}

#preview,
#confirmDialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, .05);
    box-shadow: 0 0 15px 15px rgba(0, 0, 0, .02);
    overflow: hidden;
}

html.showPreview #preview {
    display: block;
}

#preview>div {
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 1000px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #EFEFEF;
}

#preview .icon>img {
    width: 50px;
    margin: 50px;
}

#preview .body {
    width: 700px;
    max-width: calc(100vw - 200px);
    padding: 40px 40px 10px 40px;
    background: white;
}

#preview .body>h1 {
    margin-top: 0;
    text-align: center;
}

#preview .body>h2 {
    margin-top: 0;
}

#preview .body>div {
    margin-top: 0px;
}

#preview .body>p {
    text-align: center;
    font-style: italic;
    font-size: 80%;
    opacity: .8;
}

#preview .footer {
    margin-bottom: 20px;
}

#preview .footer>p {
    text-align: center;
}

#preview .close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

#preview .close::before,
#preview .close::after {
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 3px;
    border-radius: 1.5px;
    background: var(--primary-color);
}

#preview .close::before {
    transform: rotate(45deg) translate(10px, 10px);
}

#preview .close::after {
    transform: rotate(-45deg) translate(-10px, 10px);
}

html.showConfirm #confirmDialog {
    display: block;
}

#confirmDialog>div {
    padding: 20px;
    background-color: white;
}

#confirmDialog p {
    margin: 0;
}

#confirmDialog .confirmButtons {
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
    margin-top: 20px;
}

#feedback {
    display: flex;
    align-items: center;
    position: fixed;
    height: 50px;
    min-width: 250px;
    max-width: calc(100vw - 60px);
    top: 20px;
    right: -100vw;
    padding: 20px;
    border-left: 5px solid;
    border-radius: 0 10px 10px 0;
    transition: all 1s;
}

#feedback.show {
    right: 20px;
}

#feedback.info {
    background-color: rgba(0, 0, 0, .15);
    color: rgba(0, 0, 0, .5);
    border-left-color: rgba(0, 0, 0, .5);
}

#feedback.success {
    background-color: var(--primary-color);
    color: white;
    border-left-color: var(--dark-color);;
}

#feedback.error {
    background-color: var(--error-bgcolor);
    color: var(--error-color);
    border-left-color: var(--error-color);
}
