* {
    box-sizing: border-box;
}

    *:focus {
        outline: none;
    }

html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: Arial;
    background: rgba(24, 61, 234, 1);
    background: linear-gradient(180deg, rgba(4,193,252,1) 0%, rgba(13,133,244,1) 50%, rgba(24,61,234,1) 100%);
    padding: 0;
    min-height: 100%;
    min-height: -webkit-fill-available;
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.login-screen {
    position: relative;
    width: calc(min(350px, 90vw));
    margin: 0 auto;
    padding-left: calc(min(20px, 2vw));
    padding-right: calc(min(20px, 2vw));
    padding-top: calc(min(20px, 2vh));
    padding-bottom: calc(min(20px, 2vh));
    background-color: rgba(0,0,0,0.1);
    border-radius: 15px;
    color: white;
    border: 2px;
    border-style: solid;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.25);
}

    .login-screen h2 {
        margin-top: 0;
        color: white;
    }

#login-go {
    font-weight: normal;
    font-family: 'Fredoka One';
    font-size: 20px;
}

.app-title {
    text-align: center;
    color: #777;
}

.loading-img {
    height: calc(min(20vh, 120px));
    display: none;
    margin: auto;
    width: 80%;
    object-fit: contain;
}

.logo-img {
    height: calc(min(20vh, 120px));
    display: block;
    margin: auto;
    width: 80%;
    object-fit: contain;
}


input.qx-login-input {
    text-align: center;
    background-color: #ECF0F1;
    border: 2px solid transparent;
    border-radius: 100px;
    font-size: 20px;
    font-weight: 200;
    padding: calc(min(10px, 1vh)) 0;
    width: calc(min(90%, 290px));
    transition: border .5s;
}

.btn {
    border: 2px solid transparent;
    background: #2196F3;
    color: #ffffff;
    font-size: 20px;
    padding: calc(min(10px, 1vh)) 0;
    text-decoration: none;
    text-shadow: none;
    border-radius: 100px;
    box-shadow: none;
    transition: 0.25s;
    display: block;
    width: calc(min(90%, 290px));
    margin: 0 auto;
}

    .btn:hover {
        background-color: #45a6f3;
    }

@media screen and (max-height: 190px ) {
    .logo-img {
        display: none;
    }
}

@media screen and (max-height: 130px ) {
    .login-screen {
        border-style: none;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
    }
}

@media screen and (max-width: 195px ) {
    .logo-img {
        height: auto;
    }

    input {
        border-radius: 5px;
    }

    .btn {
        border-radius: 5px;
    }
}

.login-form {
    text-align: center;
}

.control-group {
    margin-bottom: 10px;
}
/*
.qx-avatar-btn {
    position: absolute;
    top: -28px;
    right: 12px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 3px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: border-color .2s;
    flex-shrink: 0;
}

    .qx-avatar-btn:hover {
        border-color: rgba(255, 255, 255, 1);
    }

.qx-avatar-preview {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qx-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2196F3;
}

    .qx-avatar-placeholder svg {
        width: 65%;
        height: 65%;
    }

.qx-avatar-menu {
    position: absolute;
    top: 32px;
    right: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 200;
    min-width: 160px;
}

.qx-avatar-menu-item {
    display: block;
    width: 100%;
    padding: 13px 18px;
    background: none;
    border: none;
    border-top: 1px solid #f0f0f0;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    color: #333;
}

    .qx-avatar-menu-item:first-child {
        border-top: none;
    }

    .qx-avatar-menu-item:hover {
        background: #f5f5f5;
    }

.qx-avatar-menu-clear {
    color: #e53e3e;
}
    */

/* ===== Camera modal ===== */
/*
.qx-camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qx-camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.qx-camera-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.qx-camera-controls {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.qx-camera-capture-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: white;
    border: 5px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    outline: none;
}

.qx-camera-capture-btn:active {
    transform: scale(0.93);
}
*/

.pin-code-field {
    font-weight: bold !important;
}

.nickname-field {
    font-weight: bold !important;
}

h6 {
    margin-top: -10px;
    font-weight: normal;
    user-select: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
    color: lightgray;
}

@media screen and (max-height: 300px ) {
    #qx-login-incognito {
        display: none;
    }
}

@media screen and (max-width: 150px ) {
    #qx-login-incognito {
        display: none;
    }
}

h2 {
    font-size: calc(min(12vw, max(12px, min(24px, 5vh))));
}

@media screen and (max-height: 150px ) {
    #qx-login-subtitle {
        display: none;
    }
}

.login-link {
    font-size: 12px;
    color: white;
    display: block;
    margin-top: 12px;
}

@media screen and (max-height: 220px ) {
    .login-link {
        display: none;
    }
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

#pulse-container {
    height: 396px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    width: calc(min(319px, 83vw));
    margin: -150px auto;
    z-index: -1;
}

@media screen and (max-width: 150px ) {
    #pulse-container {
        display: none;
    }
}

@media screen and (max-height: 300px ) {
    #pulse-container {
        display: none;
    }
}

.pulse-circle {
    border-radius: 50%;
    background-color: deepskyblue;
    width: calc(min(35vw, 200px));
    height: calc(min(35vw, 200px));
    position: absolute;
    opacity: 0;
    animation: scaleIn 4s infinite cubic-bezier(.36, .11, .89, .32);
    z-index: -1;
}

@keyframes scaleIn {
    from {
        transform: scale(.5, .5);
        opacity: .5;
    }

    to {
        transform: scale(2.5, 2.5);
        opacity: 0;
    }
}

/* ===== Custom Fields ===== */

.qx-cf-intro {
    text-align: center;
    color: #555;
    font-size: 14px;
    margin: 6px 4px 12px 4px;
}

.qx-cf-card {
    background-color: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 14px;
    max-height: 50vh;
    overflow-y: auto;
}

.qx-cf-field {
    margin-bottom: 14px;
}

    .qx-cf-field:last-child {
        margin-bottom: 0;
    }

.qx-cf-label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.qx-cf-label-info {
    color: #777;
    font-weight: normal;
}

.qx-cf-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: 100px;
    background-color: #ECF0F1;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    font-family: inherit;
    -webkit-appearance: none;
    text-align: left;
}

    .qx-cf-input::placeholder {
        color: #aaa;
        font-weight: normal;
    }

    .qx-cf-input:focus {
        border-color: #38CF20;
        outline: none;
    }

.qx-cf-error .qx-cf-label {
    color: #e74c3c;
}

.qx-cf-error .qx-cf-input {
    border-color: #e74c3c;
}

/* Boolean toggle switch */
.qx-cf-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

    .qx-cf-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.qx-cf-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 28px;
    transition: background-color .3s;
}

    .qx-cf-slider::before {
        content: "";
        position: absolute;
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        border-radius: 50%;
        transition: transform .3s;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }

.qx-cf-switch input:checked + .qx-cf-slider {
    background-color: #38CF20;
}

    .qx-cf-switch input:checked + .qx-cf-slider::before {
        transform: translateX(22px);
    }

/* Consent */
.qx-cf-consent {
    margin: 14px 0 0 0;
    padding: 8px 6px;
    background-color: rgba(0,0,0,0.02);
    border-radius: 12px;
}

.qx-cf-consent-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #777;
    font-size: 12px;
    cursor: pointer;
}

    .qx-cf-consent-label input[type="checkbox"] {
        margin-top: 2px;
        flex-shrink: 0;
        accent-color: #38CF20;
    }

/* Buttons */
.qx-cf-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.qx-cf-btn {
    flex: 1;
    padding: 1vh;
    border: none;
    border-radius: 100px;
    font-family: 'Fredoka One', Arial, sans-serif;
    font-size: calc(min(22px, 4vh));
    cursor: pointer;
    color: white;
    background: #38CF20;
    text-shadow: 0 -2px #17A800;
    border-bottom: calc(min(0.4vh, 5px)) solid #17A800;
    transition: all 0.1s;
    -webkit-transition: all 0.1s;
}

    .qx-cf-btn:hover {
        background: #22F501;
        text-shadow: 0 -2px #38CF20;
        border-bottom: calc(min(0.4vh, 5px)) solid #38CF20;
    }

    .qx-cf-btn:active {
        transform: translate(0, 5px) scale(0.98);
        -webkit-transform: translate(0, 5px) scale(0.98);
        border-bottom: 1px solid;
    }

.qx-cf-btn-full {
    flex: 1 1 100%;
}

.qx-avatar-btn {
    position: absolute;
    top: -34px;
    right: 18px;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.24) 0%, rgba(76, 17, 95, 0.72) 100%);
    border: 3px solid rgba(247, 224, 255, 0.72);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14), 0 0 20px rgba(112, 50, 132, 0.4), 0 12px 24px rgba(0, 0, 0, 0.38);
    transition: border-color .2s;
    flex-shrink: 0;
}

    .qx-avatar-btn:hover {
        border-color: rgba(255, 255, 255, 1);
    }

.qx-avatar-preview {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qx-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #5a1272 0%, #360046 100%);
}

    .qx-avatar-placeholder svg {
        width: 65%;
        height: 65%;
    }

.qx-avatar-menu {
    position: absolute;
    top: 32px;
    right: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 200;
    min-width: 160px;
}

.qx-avatar-menu-item {
    display: block;
    width: 100%;
    padding: 13px 18px;
    background: none;
    border: none;
    border-top: 1px solid #f0f0f0;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    color: #333;
}

    .qx-avatar-menu-item:first-child {
        border-top: none;
    }

    .qx-avatar-menu-item:hover {
        background: #f5f5f5;
    }

.qx-avatar-menu-clear {
    color: #e53e3e;
}

/* ===== Camera modal ===== */

.qx-camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qx-camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.qx-camera-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.qx-camera-controls {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.qx-camera-capture-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: white;
    border: 5px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    outline: none;
}

    .qx-camera-capture-btn:active {
        transform: scale(0.93);
    }

@media screen and (max-width: 420px) {
    .login-screen {
        padding-top: 32px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .qx-avatar-btn {
        width: 60px;
        height: 60px;
        top: -28px;
        right: 12px;
    }

    #qx-login-subtitle {
        font-size: clamp(12px, 8vw, 32px);
    }
}
