/* YWS: the sign-in, forgot-password and new-password pages in the studio look.
   Light: cream page, sage accents. Dark: the Studio Board / Studio Desk colours.
   <html data-yws-theme="light|dark"> is set from the same choice as the CRM's theme button. */

.yws-signin {
    --s-bg: #f8f5ed;
    --s-panel: #ffffff;
    --s-ink: #2f3328;
    --s-muted: #7d8271;
    --s-line: #e2dfd3;
    --s-field: #ffffff;
    --s-accent: #6b705c;
    --s-accent-hover: #575b4a;
    --s-on-accent: #ffffff;
    --s-ring: rgba(107, 112, 92, .22);
    --s-link: #6b705c;
    --s-soft: #eef0e6;
    --s-brand-a: rgba(27, 30, 23, .04);
    --s-brand-b: rgba(27, 30, 23, .78);
}

html[data-yws-theme="dark"] .yws-signin {
    --s-bg: #1b1e17;
    --s-panel: #24281f;
    --s-ink: #f8f5ed;
    --s-muted: #b3b7a3;
    --s-line: #3c4233;
    --s-field: #2d3227;
    --s-accent: #a9af90;
    --s-accent-hover: #bcc2a4;
    --s-on-accent: #1b1e17;
    --s-ring: rgba(169, 175, 144, .28);
    --s-link: #c9cfae;
    --s-soft: #2d3227;
    --s-brand-a: rgba(27, 30, 23, .3);
    --s-brand-b: rgba(20, 22, 17, .92);
}

html:has(body.yws-signin),
body.yws-signin {
    background: #f8f5ed !important;
}

html[data-yws-theme="dark"]:has(body.yws-signin),
html[data-yws-theme="dark"] body.yws-signin {
    background: #1b1e17 !important;
}

html:has(body.yws-signin),
body.yws-signin {
    background-image: none !important;
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.yws-signin,
.yws-signin input,
.yws-signin button {
    font-family: "Lato", "Helvetica Neue", Arial, sans-serif !important;
}

.yws-signin {
    color: var(--s-ink);
    transition: background-color .2s ease, color .2s ease;
}

/* ---------- layout: photo side + form side ---------- */

.yws-signin-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.yws-signin-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 52px;
    color: #f8f5ed;
    background-color: #6b705c;
    background-image: linear-gradient(180deg, var(--s-brand-a) 0%, var(--s-brand-a) 35%, var(--s-brand-b) 100%), var(--yws-signin-photo, linear-gradient(135deg, #a9af90 0%, #6b705c 100%));
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.yws-signin-logo {
    width: 92px;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

.yws-signin-brand-words {
    max-width: 460px;
}

.yws-signin-kicker {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(248, 245, 237, .14);
    border: 1px solid rgba(248, 245, 237, .25);
    margin-bottom: 18px;
}

.yws-signin-brand h1 {
    font-size: 44px;
    line-height: 1.12;
    font-weight: 700;
    color: #f8f5ed;
    margin: 0 0 14px;
}

.yws-signin-brand p {
    font-size: 16px;
    line-height: 1.55;
    color: rgba(248, 245, 237, .82);
    margin: 0;
}

.yws-signin-main {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px 24px;
    min-width: 0;
}

.yws-signin-panel {
    width: 100%;
    max-width: 400px;
    margin: auto 0;
}

.yws-signin-logo-small {
    display: none;
}

.yws-signin-title {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--s-ink);
    margin: 0 0 6px;
}

.yws-signin-lead {
    font-size: 15px;
    color: var(--s-muted);
    margin: 0 0 28px;
}

/* the light / dark button */
.yws-signin-theme {
    position: absolute;
    top: 46px;
    right: 22px;
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 50%;
    border: 1px solid var(--s-line);
    background: var(--s-panel);
    color: var(--s-muted);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.yws-signin-theme:hover {
    color: var(--s-ink);
    border-color: var(--s-accent);
}

.yws-signin-theme svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ---------- the form: RISE's card, made flat ---------- */

.yws-signin .form-signin {
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.yws-signin .form-signin .card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.yws-signin .form-signin .card-header {
    display: none !important;
}

.yws-signin .form-signin .card-body {
    padding: 0 !important;
    background: transparent !important;
    color: var(--s-ink);
}

.yws-signin .form-group {
    margin-bottom: 14px;
}

.yws-signin label {
    color: var(--s-muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

#request-password-form label {
    display: none;
}

.yws-signin .form-control {
    height: 50px;
    padding: 12px 16px !important;
    font-size: 15px;
    color: var(--s-ink) !important;
    background: var(--s-field) !important;
    border: 1px solid var(--s-line) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.yws-signin .form-control::placeholder {
    color: var(--s-muted);
    opacity: .85;
}

.yws-signin .form-control:focus {
    border-color: var(--s-accent) !important;
    box-shadow: 0 0 0 4px var(--s-ring) !important;
    outline: none;
}

/* browsers' saved-login yellow, in the page's colours */
.yws-signin .form-control:-webkit-autofill {
    -webkit-text-fill-color: var(--s-ink);
    -webkit-box-shadow: 0 0 0 40px var(--s-field) inset !important;
    caret-color: var(--s-ink);
}

.yws-signin-pass {
    position: relative;
}

.yws-signin-pass .form-control {
    padding-right: 48px !important;
}

.yws-signin-eye {
    position: absolute;
    top: 0;
    right: 4px;
    height: 50px;
    width: 42px;
    border: none;
    background: transparent;
    color: var(--s-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yws-signin-eye:hover {
    color: var(--s-ink);
}

.yws-signin .btn-primary,
.yws-signin #code-verify {
    height: 50px;
    font-size: 15px !important;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--s-on-accent) !important;
    background: var(--s-accent) !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 18px rgba(47, 51, 40, .14) !important;
    margin-top: 6px;
    transition: background-color .15s ease, transform .1s ease;
}

.yws-signin .btn-primary:hover,
.yws-signin .btn-primary:focus {
    background: var(--s-accent-hover) !important;
}

.yws-signin .btn-primary:active {
    transform: translateY(1px);
}

.yws-signin .btn-default {
    height: 46px;
    font-weight: 700;
    color: var(--s-ink) !important;
    background: var(--s-panel) !important;
    border: 1px solid var(--s-line) !important;
    border-radius: 12px !important;
}

.yws-signin .btn-default:hover {
    border-color: var(--s-accent) !important;
}

.yws-signin .card-body a {
    color: var(--s-link);
    font-weight: 700;
    font-size: 14px;
}

.yws-signin .card-body a:hover {
    color: var(--s-ink);
}

/* "Keep me signed in on this device" */
.yws-signin label.yws-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--s-ink);
    cursor: pointer;
    user-select: none;
}

.yws-signin .yws-remember input {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1.5px solid var(--s-line);
    border-radius: 6px;
    background: var(--s-field);
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: background-color .15s ease, border-color .15s ease;
}

.yws-signin .yws-remember input::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid var(--s-on-accent);
    border-bottom: 2px solid var(--s-on-accent);
    transform: rotate(-45deg) translate(1px, -1px);
    opacity: 0;
}

.yws-signin .yws-remember input:checked {
    background: var(--s-accent);
    border-color: var(--s-accent);
}

.yws-signin .yws-remember input:checked::after {
    opacity: 1;
}

.yws-signin .yws-remember input:focus-visible {
    box-shadow: 0 0 0 4px var(--s-ring);
    outline: none;
}

/* "Forgot password?" sits on the right under the button */
.yws-signin #signin-form + .mt5,
.yws-signin #request-password-form + .mt5,
.yws-signin #reset-password-form + .mt5 {
    margin-top: 14px !important;
    text-align: right;
}

/* "Sign in with a code on WhatsApp": a second way in, under an "or" line */
.yws-signin #code-signin-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border: 1px solid var(--s-line);
    border-radius: 12px;
    background: var(--s-panel);
    color: var(--s-ink);
    text-decoration: none;
    transition: border-color .15s ease;
}

.yws-signin #code-signin-toggle:hover {
    border-color: var(--s-accent);
}

.yws-signin #code-signin-toggle svg {
    color: #25d366;
}

.yws-signin #code-signin-toggle {
    margin-top: 0;
}

.yws-signin #code-signin-toggle::before {
    content: none;
}

.yws-signin .mt10:has(> #code-signin-toggle) {
    position: relative;
    margin-top: 22px !important;
    padding-top: 30px;
}

.yws-signin .mt10:has(> #code-signin-toggle)::before {
    content: "or";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 12px;
    background: var(--s-bg);
    color: var(--s-muted);
    font-size: 13px;
    line-height: 18px;
    z-index: 1;
}

.yws-signin .mt10:has(> #code-signin-toggle)::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 0;
    right: 0;
    border-top: 1px solid var(--s-line);
}

.yws-signin .alert {
    border-radius: 12px;
    border: none;
}

.yws-signin .text-success {
    color: #5f8f5a !important;
}

html[data-yws-theme="dark"] .yws-signin .text-success {
    color: #9fc79a !important;
}

html[data-yws-theme="dark"] .yws-signin .text-danger,
html[data-yws-theme="dark"] .yws-signin .error {
    color: #ec8a77 !important;
}

/* ---------- footer: quiet, under the form ---------- */

.yws-signin-footer {
    width: 100%;
    max-width: 400px;
    margin-top: 32px;
}

.yws-signin-footer .footer {
    background: transparent !important;
    color: var(--s-muted) !important;
    border: none !important;
    padding: 0 !important;
}

.yws-signin-footer .footer .container {
    padding: 0 !important;
    max-width: none;
}

.yws-signin-footer .footer *,
.yws-signin-footer .footer a {
    color: var(--s-muted) !important;
    font-size: 12px;
}

.yws-signin-footer .copyright-section {
    padding: 0 !important;
    justify-content: center !important;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- tablets and phones: the photo becomes a band on top ---------- */

@media (max-width: 991px) {
    .yws-signin-wrap {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .yws-signin-brand {
        min-height: 0;
        padding: 40px 24px 26px;
        flex-direction: row;
        align-items: flex-end;
        justify-content: flex-start;
        gap: 18px;
    }

    .yws-signin-logo {
        width: 64px;
        border-radius: 14px;
    }

    .yws-signin-kicker {
        display: none;
    }

    .yws-signin-brand h1 {
        font-size: 24px;
        margin: 0;
    }

    .yws-signin-brand h1 br {
        display: none;
    }

    .yws-signin-brand p {
        display: none;
    }

    .yws-signin-main {
        justify-content: flex-start;
        padding: 32px 20px 24px;
    }

    .yws-signin-panel {
        margin: 0;
    }

    .yws-signin-theme {
        top: auto;
        bottom: auto;
        position: absolute;
        right: 16px;
        top: -19px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    }

    .yws-signin-title {
        font-size: 26px;
    }

    .yws-signin-lead {
        margin-bottom: 22px;
    }

    .yws-signin-footer {
        margin-top: 28px;
    }
}

@media (max-width: 420px) {
    .yws-signin-brand h1 {
        font-size: 20px;
    }
}
