/* The login page as the game's front page: what TradeChronicles is, beside the
   sign-in card (under it on narrow screens, so returning merchants sign in first). */

/* the page grows with the description: one sea gradient over all of it */
html,
body {
    height: auto;
    min-height: 100%;
}

body {
    background-color: var(--sea-deep);
    background-repeat: no-repeat;
}

/* the harbour painting behind the page, fixed while it scrolls, darkened so the
   title and the cards stay readable; phones get a smaller copy */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(8, 20, 34, 0.45), rgba(8, 20, 34, 0.72)),
        url("/auth/img/background.webp?v=20261104-1") center / cover no-repeat;
}

@media (max-width: 900px) {
    body::before {
        background-image:
            linear-gradient(180deg, rgba(8, 20, 34, 0.5), rgba(8, 20, 34, 0.78)),
            url("/auth/img/background-1024.webp?v=20261104-1");
    }
}

.landing {
    position: relative;
    min-height: 100vh;
    align-items: flex-start;
    padding: 40px 24px;
}

/* desktop: the title centred across the page, the features on the left and the
   sign-in card on the right, level with the first feature card; narrow screens:
   title, then the card, then the features */
.landing-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas:
        "head head"
        "ftitle ."
        "features side"
        "ptitle side"
        "premium side"
        "foot foot";
    column-gap: 48px;
    align-items: start;
    width: 100%;
    max-width: 1160px;
}

.landing-head {
    grid-area: head;
    text-align: center;
    color: var(--parchment);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 14px rgba(8, 20, 34, 0.6);
}

.landing-features {
    grid-area: features;
}

/* "Key Features", above the cards */
.landing-features-title {
    grid-area: ftitle;
    margin: 0 0 12px;
    font-size: 1.3rem;
    color: #f3d27a;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 14px rgba(8, 20, 34, 0.6);
}

/* "Premium Features", below the key features */
.landing-premium-title {
    grid-area: ptitle;
    margin-top: 28px;
}

.landing-premium {
    grid-area: premium;
}

.landing-side {
    grid-area: side;
    position: sticky;
    top: 40px;
}

.landing-title {
    margin: 0 0 6px;
    font-size: 2.6rem;
    line-height: 1.1;
    text-align: center;
}

.landing-tagline {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-style: italic;
    color: #e8c35a;
}

/* what the game is about, in a sentence, under the tagline */
.landing-summary {
    max-width: 780px;
    margin: 0 auto 12px;
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--parchment);
    text-wrap: balance;
}

/* the game's stage of development, under the tagline */
.landing-stage {
    margin: 0 0 28px;
    font-size: 0.92rem;
    color: rgba(244, 242, 236, 0.85);
}

.landing-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #14243a;
    text-shadow: none;
    background: #e8c35a;
    border-radius: 999px;
}

/* registering: under the Terms checkbox */
.register-note {
    margin: 10px 0 0;
    font-size: 0.75rem;
    font-style: italic;
    color: #44607a;
}

/* in the sign-in card, at the top of the form */
.card-cta {
    margin: -10px 0 14px;
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    text-wrap: balance;
    color: #44607a;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.landing-feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    background: rgba(8, 20, 34, 0.6);
    border: 1px solid rgba(184, 137, 43, 0.45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    border-radius: 8px;
}

.landing-feature img {
    width: 44px;
    height: 44px;
    flex: none;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.landing-feature h3 {
    margin: 0 0 4px;
    font-size: 1.02rem;
    color: #f3d27a;
}

.landing-feature p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #d5dfe8;
}

@media (max-width: 900px) {
    .landing {
        padding: 24px 16px;
    }

    .landing-wrap {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "head"
            "side"
            "ftitle"
            "features"
            "ptitle"
            "premium"
            "foot";
        row-gap: 0;
        max-width: 640px;
    }

    .landing-head {
        text-align: center;
    }

    .landing-title {
        font-size: 2rem;
        text-align: center;
    }

    .landing-tagline {
        font-size: 1.1rem;
    }

    .landing-stage {
        margin-bottom: 20px;
    }

    .landing-side {
        position: static;
        justify-self: center;
        width: 100%;
        max-width: 380px;
        margin-bottom: 32px;
    }
}

@media (max-width: 600px) {
    .landing-features {
        grid-template-columns: 1fr;
    }

    .landing-title {
        font-size: 1.75rem;
    }

    .landing-tagline {
        font-size: 1.05rem;
    }

    .landing-summary {
        font-size: 0.78rem;
    }
}

/* registering: a mismatched password confirmation, and the button until the form is complete */
.field-error {
    color: var(--error);
    font-style: normal;
    opacity: 1;
}

.card button.not-ready:disabled {
    cursor: not-allowed;
}

/* View on Steam, at the top right of the page: greyed out until the store page is live */
/* top left: Discord as a flag from the left edge */
.landing-social {
    position: absolute;
    top: 18px;
    left: 0;
    right: 24px;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.landing-social .discord-flag {
    pointer-events: auto;
}

/* Discord: a ribbon from the page's left edge with a notch in its end, like a bookmark.
   The shadow sits on the wrapper, since the clip would cut it off the flag itself. */
.discord-flag-shadow {
    display: block;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.discord-flag {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    padding: 0 34px 0 20px;
    font-size: 0.92rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    background: linear-gradient(#6470f4, #5865f2 55%, #4f5be0);
    clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%);
    transition: transform 0.15s, background-color 0.15s;
}

.discord-flag:hover {
    background: linear-gradient(#5865f2, #4752c4);
    transform: translateX(4px);
}

.social-icon {
    width: 22px;
    height: 22px;
    flex: none;
}

/* Steam, top right */
.steam-link {
    position: absolute;
    top: 18px;
    right: 24px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.92rem;
    font-weight: bold;
    color: #fff;
    background: #1b2838;
    border: 1px solid #2a475e;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    text-decoration: none;
}

.steam-link:not([aria-disabled="true"]):hover {
    background: #2a475e;
}

.steam-link[aria-disabled="true"] {
    color: rgba(255, 255, 255, 0.6);
    cursor: not-allowed;
}

.steam-link[aria-disabled="true"] .steam-icon {
    opacity: 0.6;
}

.steam-icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.steam-soon {
    font-size: 0.8rem;
    font-weight: normal;
    font-style: italic;
}

/* narrow screens: a smaller button, and the title starts below it */
@media (max-width: 760px) {
    .landing {
        padding-top: 64px;
    }

    .landing-social {
        top: 14px;
        left: 0;
        right: 16px;
    }

    .discord-flag {
        height: 38px;
        padding: 0 28px 0 14px;
        gap: 7px;
        font-size: 0.84rem;
        clip-path: polygon(0 0, 100% 0, calc(100% - 13px) 50%, 100% 100%, 0 100%);
    }

    .steam-link {
        top: 14px;
        right: 16px;
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .social-icon {
        width: 20px;
        height: 20px;
    }
}

/* after signing in: the worlds to choose from, one row each */
.world-table {
    width: 100%;
    margin: 4px 0 0;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.world-table th {
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    color: #44607a;
    border-bottom: 1px solid #bccbd8;
}

.world-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #e0e8ee;
    cursor: pointer;
}

.world-table tbody tr:hover td {
    background: #eef3f7;
}

.world-table tbody tr.picked td {
    background: #e1eaf2;
}

.world-name label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.world-name input {
    width: auto;
    margin: 0;
    padding: 0;
    accent-color: var(--sea);
}

.world-state {
    display: inline-block;
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 999px;
}

.world-state.stable {
    color: #1f5a30;
    background: #d3ead8;
}

.world-state.unstable {
    color: #7a4a00;
    background: #f7e3b5;
}

.world-state.other {
    color: #44607a;
    background: #e3eaf0;
}

.world-opened {
    white-space: nowrap;
    color: #44607a;
}

/* bottom of the page: Terms of Use · Privacy Notice */
.landing-footer {
    grid-area: foot;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 16px;
    font-size: 0.88rem;
    color: rgba(244, 242, 236, 0.75);
    border-top: 1px solid rgba(244, 242, 236, 0.2);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.landing-footer a {
    color: #f3d27a;
    text-decoration: none;
}

.landing-footer a:hover {
    text-decoration: underline;
}

/* phones: the Steam note goes under "View on Steam", so the button clears the Discord flag */
@media (max-width: 480px) {
    .landing {
        padding-top: 82px;
    }

    .steam-link {
        display: grid;
        grid-template-columns: auto auto;
        align-items: center;
        column-gap: 8px;
        line-height: 1.2;
    }

    .steam-link .steam-icon {
        grid-row: span 2;
    }
}
