/*
 * The public pages (home with login and registration, password recovery and reset) on any screen.
 * Loaded after the page's own stylesheet, which lays everything out in fixed pixels:
 *   - the recovery pages: their box in the middle of the window instead of at a fixed place;
 *   - under 760 px: one column as wide as the screen, fields a finger can hit.
 * The artwork and the look of these pages stay as they are.
 */

/* ---- password recovery and reset: the box in the middle ---- */

/* the picture behind the page has a frame painted into it, 526 px from its left edge: the frame goes to the
   middle of the window and the box stands on it */
body#login {
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 236px 16px 16px;
    background-position: calc(50vw - 526px) 0;
    font-size: 13px;
    line-height: 1.4;
}

body#login #recoverpassword {
    width: min(100%, 372px);
}

#login #error {
    position: static;
    box-sizing: border-box;
    width: auto;
    margin: 0 0 12px;
    padding: 12px 8px;
    text-align: center;
}

#login #loginwrapper {
    position: static;
    box-sizing: border-box;
    width: auto;
    height: auto;
    padding: 16px;
    border: 1px solid #202733;
    border-radius: 4px;
    background: rgb(13 16 20 / 0.94);
}

#login #loginwrapper h2 {
    margin: 0 0 12px;
    color: #c1c1c1;
    font-size: 14px;
}

#login #loginwrapper .wrap-inner {
    float: none;
    width: auto;
    height: auto;
    padding: 0;
}

#login #loginwrapper label {
    margin: 10px 0 4px;
    font-size: 13px;
}

#login #loginwrapper .input,
#login #loginwrapper input.start {
    box-sizing: border-box;
    width: 100%;
    height: 36px;
    font-size: 14px;
}

#login #loginwrapper .input {
    padding: 0 8px;
}

#login #loginwrapper input.start {
    margin-top: 14px;
    font-size: 13px;
}

#login #loginwrapper #advice {
    float: none;
    width: auto;
    font-size: 13px;
}

#login #loginwrapper #advice p {
    width: auto;
    margin: 0;
    padding: 12px 0 0;
}

/* ---- home: one column on a phone ---- */

@media (max-width: 760px) {
    body {
        font-size: 14px;
    }

    #start {
        height: auto !important;
        min-height: 0;
        margin: 0;
        background-position: 62% 32px;
        background-size: auto 520px;
    }

    #push {
        display: none;
    }

    #header,
    #content,
    #footerContent {
        box-sizing: border-box;
        width: auto;
        margin: 0;
        padding-inline: 12px;
    }

    /* logo and login button on a line, the login form under them when it is open */
    #header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        height: auto;
        padding-top: 44px;
    }

    #header h1 {
        float: none;
        width: auto;
        height: auto;
        margin: 0;
    }

    #header h1 img {
        display: block;
        width: 160px;
    }

    #header h1 a {
        height: 0;
    }

    a#loginBtn {
        float: none;
        flex: none;
        height: 44px;
        margin: 0;
        border-radius: 4px;
        background: #7a1c1c;
        line-height: 44px;
    }

    #login {
        position: static;
        box-sizing: border-box;
        flex: 1 0 100%;
        width: auto;
        height: auto;
        padding: 12px;
        border: 1px solid #2d343c;
        border-radius: 4px;
        background: #0b1118;
    }

    #loginForm {
        width: auto;
        height: auto;
        margin: 0;
    }

    #loginForm a#pwLost {
        display: inline-block;
        height: auto;
        padding-block: 8px;
        background-position: 0 12px;
        font-size: 13px;
    }

    /* the registration form, then the texts */
    #subscribe,
    #contentWrap {
        display: block;
        float: none;
        width: auto;
        margin: 12px 0;
    }

    #subscribeForm {
        width: auto;
        padding-bottom: 4px;
    }

    #subscribeForm h2 {
        padding: 6px 10px;
    }

    #subscribeForm .input-wrap,
    #subscribeForm .first {
        height: auto;
        padding: 6px 10px 10px;
        background-image: none;
    }

    label,
    #subscribeForm label {
        width: auto;
        height: auto;
        margin: 4px 0;
        font-size: 13px;
        line-height: 1.3;
    }

    .black-border,
    #loginForm .black-border,
    .server_table,
    #securePwd,
    #securePwd p {
        box-sizing: border-box;
        width: 100%;
        margin-inline: 0;
    }

    /* 16 px: a smaller field makes a phone zoom into the page when it is tapped */
    .black-border input,
    #loginForm .black-border input,
    select#serverLogin,
    select#server {
        box-sizing: border-box;
        width: 100%;
        height: 40px;
        font-size: 16px;
    }

    .server_table {
        height: 40px;
    }

    #uni_selection {
        top: 40px;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 200px;
    }

    .server-row {
        box-sizing: border-box;
        width: 100%;
        padding: 10px 8px;
    }

    #securePwd .securePwdBarBox {
        width: 180px;
    }

    #subscribeForm #submitWrap {
        padding: 8px 10px;
        background-size: auto 100%;
    }

    #subscribeForm #submitWrap label {
        width: auto;
        height: auto;
        margin: 0 0 10px;
        font-size: 13px;
    }

    #stayLoggedIn,
    #agb {
        width: 22px;
        height: 22px;
        margin: 0 8px 8px 0;
    }

    input#regSubmit,
    #loginForm #loginSubmit {
        width: 205px;
        max-width: 100%;
    }

    #loginForm #loginSubmit {
        width: 187px;
    }

    /* the tabs: a row of links instead of the picture of a row of links */
    #menu {
        display: flex;
        flex-wrap: wrap;
        height: auto;
        border-bottom: 1px solid #2d343c;
        background: #131820 !important;
    }

    #menu br {
        display: none;
    }

    #tabs {
        display: contents;
        float: none;
        width: auto;
        height: auto;
        margin: 0;
    }

    #tab4,
    #tab5,
    #tabs li {
        float: none;
        flex: 1 0 auto;
        width: auto;
        height: 44px;
    }

    #tab4,
    #tab5,
    #tabs li a {
        padding: 0 8px;
        line-height: 44px;
    }

    #tabs li a.current {
        border-bottom: 2px solid #91b0c4;
    }

    #tabContent {
        box-sizing: border-box;
        width: auto;
        padding: 10px;
        background: #131820;
    }

    #contentFooter {
        display: none;
    }

    #tabContent img,
    #tabContent video,
    #trailer img {
        max-width: 100%;
        height: auto;
    }

    #flashTrailer {
        width: auto;
        max-width: 100%;
    }

    /* a heading that takes two lines must not run into the text under it */
    #tabContent h2,
    #tabContent h3 {
        height: auto;
        padding-block: 6px;
        line-height: 1.3;
    }

    #wallpapers,
    #screens {
        width: auto;
    }

    #footer {
        height: auto;
        margin: 0;
        padding: 16px 0;
        background-position: 50% 0;
    }

    /* the messages of the forms: under their field, inside the screen */
    .formError,
    body .passwordLoginformError,
    body .usernameLoginformError {
        right: 12px;
        left: 12px !important;
        margin: 44px 0 0;
        padding: 0;
    }

    .formError .formErrorContent {
        width: auto;
    }

    .formError .formErrorArrow {
        display: none;
    }
}
