:root {
    --cc: #442a8b !important;
    --ccshare: var(--cc);
    --cc-tonal: var(--cc);
    --page-bg: black;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-color: var(--cc);
    color: whitesmoke;
    user-select: none;
    border-width: 2px;
    border-radius: 9px;
    outline: none;
}

body,html {
    overscroll-behavior: contain;
}

body {
    background-color: var(--page-bg);
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;

    display: flex;
    flex-direction: column;
    align-items: center;
}

#container {
    min-height: 100dvh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1 {
    color: #686868;
    text-transform: uppercase;
}

textarea {
    resize: vertical;
    background: none;
    outline: none;
    font-size: 1rem;
    height: 10rem;
    transition: .05s;
    font-weight: light !important;
    padding: .6em .8em;
}

#form_field_wrapper {
    border-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 30em;
    max-width: 95vw;
}

form fieldset:not(#form_field_wrapper) {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

#form_field_wrapper fieldset {
    border-style: none;
}

#form_field_wrapper hr {
    border-style: none;
    width: 100%;
    height: 2px;
    background-color: var(--cc);
    padding: 0;
    margin: 0;
}

input {
    background: none;
    outline: none;
    border-style: solid;
    padding: .25em;
}

select,
option {
    background: #141314;
    color: white;
}

input,
textarea {
    border-style: solid
}

#lifetime {
    padding-left: .2em !important;
}

#uses {
    padding-left: .4em !important;
}

#token {
    border-left-style: none;
}

#token_icon_wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 50%;
    height: 2em !important;
}

#token_icon_wrapper #token {
    width: 100%;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#use_token {
    display: none;
}

#use_token_label {
    cursor: pointer;
    user-select: none;
    border: solid 1px lightgray;
    position: relative;
    border-width: 2px !important;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 9px;
    border-bottom-left-radius: 9px;
    background-color: var(--cc);
    background-image: url('lock_open.svg') !important;
    background-repeat: no-repeat;
    padding: .5em;
}

#use_token_label:has(input:checked) {
    background-image: url('lock_closed.svg') !important;
}

#use_token_label:has(input:not(:checked)) + input {
    color: #6c6c6c;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

#file_spinner {
    animation: rotate 1s linear infinite;
    width: 2em;
    height: 2em;
    margin-left: auto;
    display: none;
}

/* Material You buttons */
.btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 0 1em;
    min-height: 2.5rem;
    height: 2.5rem;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .5em;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: .01em;
    background: transparent;
    color: var(--cc);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity .15s ease;
}

.btn > * {
    position: relative;
    z-index: 1;
}

.btn:hover::after { opacity: .08; }
.btn:active::after { opacity: .14; }
.btn:disabled::after { opacity: 0; }

.btn:disabled {
    opacity: .5;
    cursor: default;
}

.btn--filled {
    background: var(--cc);
    color: #fff;
    border-color: var(--cc);
}

.btn--tonal {
    background: var(--cc-tonal);
    color: #ffffff;
    border-color: var(--cc-tonal);
}

.btn--outlined {
    background: var(--cc);
    color: #ffffff;
    border-color: var(--cc);
}

.btn--text {
    background: var(--cc);
    color: #ffffff;
    border-color: var(--cc);
    padding: .6em .8em;
}

/* formerly #submitBtn and #viewBtn */
.rr_button {
    width: 100%;
}

#form_field_wrapper:disabled > * {
    opacity: .70 !important;
    cursor: default !important;
}

@keyframes spinn {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#encSpinner {
    display: none;
    position: absolute;
    width: 2em;
    height: 2em;
    top: 50%;
    left: 50%;
    z-index: 99999;
    animation-name: spinn;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-direction: normal;
    animation-duration: 1s;
    filter: brightness(.5);
}

#submitBtn:disabled,
#submitBtn:disabled:hover {
    opacity: .4;
    cursor: default;
}

#uses,
#file_input,
#lifetime {
    width: 50%;
    border-color: lightgray;
}

/* share */

#share {
    width: 30em;
    max-width: 95vw;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#share legend,
#share fieldset {
    padding: .5em;
}

.key_fieldset {
    padding-top: 0 !important;
    margin-top: 1rem;
}

#share hr {
    width: 75%;
    height: 2px;
    margin: 1rem 0;
    border-style: none;
    background-color: lightgray;
    padding: 0;
}

#share fieldset {
    border-style: none;
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 1rem;
}

#share input {
    width: 100%;
    border-color: var(--ccshare);
    height: 2.5rem;
    min-height: 2.5rem;
    line-height: 2.5rem;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.shareset button {
    width: 75%;
}

.shareset button::before {
    content: none;
}

#qrcode {
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;
    max-width: 150px;
    max-height: 150px;
}

.key_fieldset {
    border-style: none !important;
    border-top-style: solid !important;
    text-align: center;
    border-radius: 0 !important;
}



#share button,
.v_button {
    text-transform: none;
}

#share_buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    /* gap: 1rem; */
}

#share_buttons button {
    width: 50%;
}

.rr_button:hover {
    background: var(--cc);
    opacity: .85
}




#qrcode {
    position: relative;
}

#reveal_qr {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.123);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
}

#reveal_qr img {
    width: 2rem;
    height: 2rem;
}

#refreshButton {
    display: none;
    width: 100%;
    font-size: 1.2rem;
    margin-top: 1rem;
}


#ember {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    user-select: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    overflow: hidden !important;
    z-index: -1 !important;
}

.svg-spinner {
    display: none;

  color: var(--icon-color);
  fill: none;
  stroke: currentColor;
}

html:has(.cDialog[open]) {
    overflow: hidden;
    scrollbar-gutter: stable;
}

.obsolete {
    display: none !important;
}
