/**
 * Sign in with Google and Apple (social-login-web.php): the "Continue
 * with" buttons of /login/ and /register/, the pseudo screen and "Linked
 * accounts" on the profile edit page. The buttons follow the providers'
 * brand guidelines (Google: white with a grey outline in light mode,
 * #131314 in dark mode, the four-colour logo); the rest follows
 * body.lightClass / body.darkClass like the site.
 */

/* ==========================================================================
   Buttons
   ========================================================================== */

.cw-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

.cw-social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #747775;
    border-radius: 5px;
    background: #FFFFFF;
    color: #1F1F1F;
    font-family: Roboto, Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 200ms linear, box-shadow 200ms linear;
}

.cw-social-button:hover,
.cw-social-button:focus-visible {
    background: #F2F2F2;
    color: #1F1F1F;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.cw-social-button:focus-visible {
    outline: 2px solid #4672D6;
    outline-offset: 2px;
}

body.darkClass .cw-social-button {
    border-color: #8E918F;
    background: #131314;
    color: #E3E3E3;
}

body.darkClass .cw-social-button:hover,
body.darkClass .cw-social-button:focus-visible {
    background: #1F1F21;
    color: #E3E3E3;
}

.cw-social-logo {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* "or" between the buttons and the form */
.cw-social-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    color: #868E96;
}

.cw-social-or::before,
.cw-social-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #DEE2E6;
}

body.darkClass .cw-social-or::before,
body.darkClass .cw-social-or::after {
    background: #495057;
}

/* ==========================================================================
   Pseudo screen (/register/ after a first sign-in)
   ========================================================================== */

.cw-social-signup-intro {
    margin-bottom: 16px;
    line-height: 1.5;
}

.cw-social-signup-intro strong {
    word-break: break-all;
}

.cw-social-signup .tml-field-hint code {
    word-break: break-all;
}

.cw-social-signup-existing {
    margin-top: 16px;
    font-size: 0.9em;
    text-align: center;
}

.cw-social-signup-existing p {
    margin: 0 0 8px;
}

.cw-social-signup-existing a {
    font-weight: bold;
}

.cw-social-cancel {
    color: #868E96;
}

/* ==========================================================================
   Linked accounts (profile edit page)
   ========================================================================== */

.section-account-social .cw-tml-message,
.section-account-social .cw-tml-error {
    margin: 0 0 16px;
}

.section-account-social .cw-social-intro {
    margin: 0 0 16px;
    line-height: 1.5;
}

.cw-social-accounts {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cw-social-account {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid #EFEFEF;
    border-radius: 6px;
}

body.darkClass .cw-social-account {
    border-color: #333A3E;
}

.cw-social-account .cw-social-logo {
    width: 24px;
    height: 24px;
}

.cw-social-account-texts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.cw-social-account-name {
    font-weight: 600;
    color: #495057;
}

body.darkClass .cw-social-account-name {
    color: #E9ECEF;
}

.cw-social-account-detail {
    font-size: 0.8em;
    color: #868E96;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cw-social-account-form {
    margin: 0;
    flex-shrink: 0;
}

.cw-social-account .tml-button {
    display: inline-block;
    width: auto;
    padding: 6px 14px;
    font-size: 0.85em;
    text-align: center;
    text-decoration: none;
}

.cw-social-account .tml-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.cw-social-password {
    margin-top: 16px;
}

.cw-social-password .tml-field-hint {
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .cw-social-account {
        flex-wrap: wrap;
    }

    .cw-social-account-form,
    .cw-social-account .cw-social-link {
        width: 100%;
    }

    .cw-social-account .tml-button {
        width: 100%;
    }
}
