:root {
    --primary: #6941c6!important;
    --emphasis-primary: var(--primary)!important;
    --bg-color: #ffffff!important;
    --color: rgb(28,28,28)!important;
    --light: rgb(118,118,118)!important;
    --border: rgb(247,247,247)!important;
    --emphasis: var(--light) !important;
}

body:not(.dark-mode) #app .component_filemanager_shell {
    background: rgb(250,250,250);
}
body:not(.dark-mode) #app #main {
    border-top: 1px solid rgb(241,241,241);
    border-left: 1px solid rgb(241,241,241);
    border-top-left-radius: 10px;
}
body:not(.dark-mode) #app .component_page_filespage {
    background: white;
}

/* file / folder view */
#app .list > .component_thing.view-grid {
    border-radius: 12px;
    border: 4px solid var(--border);
}

/* submenu */
body:not(.dark-mode) #app [is="component_submenu"] .component_submenu .action.left button {
    color: rgb(128,128,128);
    background: rgb(245, 245, 245);
    border: 2px solid rgb(245, 245, 245);
    font-weight: bold;
    margin-right: 5px;
    border-radius: 7px;
}
body:not(.dark-mode) #app [is="component_submenu"] .component_submenu .action.right {
    background: rgb(245, 245, 245);
    border: 2px solid rgb(245, 245, 245);
    border-radius: 7px;
}

/* upload */
body:not(.dark-mode) #app .component_mobilefileupload input[type="file"] + label {
    background: rgb(36,36,36);
}

/* modal */
component-modal .component_modal { background: rgba(83,85,89,0.9); }
component-modal .component_share .share--content.link-type > button.active,
component-modal .component_share .share--content.link-type > button:hover { color: white; }
component-modal .component_share h2 { font-weight: 400; font-size: 1.1rem; }

/* common page */
#app .component_page_connect {
    background: var(--border);
}

/* dark-mode */
.dark-mode img[alt="directory"], .dark-mode img[alt="file"] {
    filter: invert(1);
}

:root {
    --wildy-bg: #1d2127;
    --wildy-panel: #272c34;
    --wildy-panel-strong: #303640;
    --wildy-border: #404854;
    --wildy-text: #f3f5f7;
    --wildy-muted: #aeb5bf;
    --wildy-folder: #ffc84b;
    --wildy-lavender: #a268a1;
    --wildy-blue-grey: #455a64;
}

/* Local authentication page */
html:has(body.common_response_page) {
    background: var(--wildy-bg) !important;
    color-scheme: dark;
}

body.common_response_page {
    min-height: 100%;
    padding: 0 20px !important;
    background:
        radial-gradient(circle at 50% 10%, rgba(162, 104, 161, 0.18), transparent 34%),
        linear-gradient(145deg, #171a1f, var(--wildy-bg) 55%, #252a31) !important;
    color: var(--wildy-text) !important;
}

body.common_response_page form.component_middleware {
    width: min(420px, 100%);
    margin: 0 auto !important;
    padding: clamp(35px, 8vh, 90px) 30px 30px !important;
    box-sizing: border-box;
    text-align: left;
    background: var(--wildy-panel);
    border: 1px solid var(--wildy-border);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

body.common_response_page form.component_middleware::before {
    content: "WildWanderer's Fileserver";
    display: block;
    min-height: 136px;
    margin-bottom: 24px;
    padding-top: 128px;
    box-sizing: border-box;
    background: url("/assets/6463fe9fdb5e3eb40bc4b8a77ec14189643a2909/plugin/theme_wildwanderer.zip/login-logo.png") center top / 112px 112px no-repeat;
    color: var(--wildy-text);
    font-size: clamp(1.45rem, 5vw, 1.9rem);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

body.common_response_page form.component_middleware::after {
    content: "Sign in with your usual username followed by @local.";
    display: block;
    margin-top: 18px;
    color: var(--wildy-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: center;
}

body.common_response_page input:not([type="checkbox"]),
body.common_response_page textarea {
    margin: 10px 0 !important;
    padding: 13px 14px !important;
    background: #171a1f !important;
    color: var(--wildy-text) !important;
    border: 1px solid var(--wildy-border) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

body.common_response_page input::placeholder,
body.common_response_page textarea::placeholder {
    color: #8f97a2;
    opacity: 1;
}

body.common_response_page label:has(input[name="user"]) {
    position: relative;
    display: block;
}

body.common_response_page input[name="user"]::placeholder {
    color: transparent;
}

body.common_response_page label:has(input[name="user"])::before {
    content: "Username@local";
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #8f97a2;
    pointer-events: none;
}

body.common_response_page label:has(input[name="user"]:focus)::before,
body.common_response_page label:has(input[name="user"]:not(:placeholder-shown))::before {
    display: none;
}

body.common_response_page input:focus,
body.common_response_page textarea:focus {
    border-color: var(--wildy-folder) !important;
    box-shadow: 0 0 0 3px rgba(255, 200, 75, 0.14) !important;
}

body.common_response_page button,
body.common_response_page .btn {
    margin-top: 12px !important;
    padding: 12px 16px !important;
    background: var(--wildy-folder) !important;
    color: #20242a !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    letter-spacing: 0.04em;
    font-size: 0 !important;
}

body.common_response_page button::after {
    content: "SIGN IN";
    font-size: 1rem;
}

body.common_response_page button:hover,
body.common_response_page .btn:hover {
    background: #ffd875 !important;
}

body.common_response_page .flash {
    color: #ff8a8a !important;
    text-align: center;
}

/* Standard Filestash connection page */
.component_page_connect {
    min-height: 100%;
    background:
        radial-gradient(circle at 50% 10%, rgba(162, 104, 161, 0.18), transparent 34%),
        linear-gradient(145deg, #171a1f, var(--wildy-bg) 55%, #252a31) !important;
    color: var(--wildy-text);
}

.component_page_connect .component_forkme {
    display: none !important;
}

.component_page_connect [data-bind="centerthis"] {
    width: min(430px, calc(100% - 30px));
    max-width: 430px !important;
}

.component_page_connect [data-bind="centerthis"]::before {
    content: "WildWanderer's Fileserver";
    display: block;
    min-height: 136px;
    margin-bottom: 20px;
    padding-top: 128px;
    box-sizing: border-box;
    background: url("/assets/6463fe9fdb5e3eb40bc4b8a77ec14189643a2909/plugin/theme_wildwanderer.zip/login-logo.png") center top / 112px 112px no-repeat;
    color: var(--wildy-text);
    font-size: clamp(1.45rem, 5vw, 1.9rem);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.component_page_connect [data-bind="centerthis"]::after {
    content: "Sign in with your usual username followed by @local.";
    display: block;
    margin-top: 16px;
    color: var(--wildy-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: center;
}

.component_page_connection_form .box {
    padding: 24px !important;
    background: var(--wildy-panel) !important;
    color: var(--wildy-text) !important;
    border: 1px solid var(--wildy-border);
    border-radius: 14px !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38) !important;
}

.component_page_connection_form form label,
.component_page_connection_form form .advanced {
    color: var(--wildy-muted) !important;
}

.component_page_connection_form input.component_input,
.component_page_connection_form textarea.component_input {
    background: #171a1f !important;
    color: var(--wildy-text) !important;
    border: 1px solid var(--wildy-border) !important;
    border-radius: 8px !important;
}

.component_page_connection_form input.component_input:focus,
.component_page_connection_form textarea.component_input:focus {
    border-color: var(--wildy-folder) !important;
    box-shadow: 0 0 0 3px rgba(255, 200, 75, 0.14) !important;
}

.component_page_connection_form form button.emphasis {
    background: var(--wildy-folder) !important;
    color: #20242a !important;
    border-radius: 8px;
}

.component_poweredbyfilestash {
    color: var(--wildy-muted) !important;
}

/* Preserve the familiar FileBrowser folder colour. */
#app img[alt="directory"] {
    filter: sepia(1) saturate(8) hue-rotate(350deg) brightness(1.18) !important;
}

@media (max-width: 520px) {
    body.common_response_page {
        padding: 0 12px !important;
    }

    body.common_response_page form.component_middleware {
        padding-right: 20px !important;
        padding-left: 20px !important;
        border-radius: 10px;
    }

    .component_page_connect [data-bind="centerthis"] {
        width: calc(100% - 24px);
    }
}

