/**
 * KW Social Login - Frontend Styles
 *
 * @author    Kiwiku / NR Solutions
 * @copyright 2025 Kiwiku / NR Solutions
 * @license   Commercial License
 *
 * 1.3.0 - Kiwiku look: 48 px buttons, warm neutrals, the social options
 * first and the email form after an "o con tu email" separator.
 * New file name on purpose: the theme's combined CSS is cached by name.
 */

/* Container */
.kwsl-social-login {
    width: 100%;
    margin: 20px 0;
    padding: 0;
    font-family: inherit;
    color: #1F1B18;
}

/* Once it has moved above the form */
.kwsl-social-login.kwsl-top {
    max-width: 440px;
    margin: 4px auto 24px;
}

/* In the checkout it lives in a card as wide as the step */
.kwsl-social-login.kwsl-ctx-checkout.kwsl-top {
    max-width: none;
    margin: 12px 0 20px;
}

.kwsl-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kwsl-ctx-checkout .kwsl-card {
    background: #FFFFFF;
    border: 1px solid #E2DBCF;
    border-radius: 12px;
    padding: 16px;
}

.kwsl-express-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1F1B18;
}

.kwsl-express-head svg {
    color: #8A6A1F;
    flex-shrink: 0;
}

.kwsl-express-text {
    margin: -4px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #6B635B;
}

/* Buttons */
.kwsl-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kwsl-social-login .kwsl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid #CFC8BC;
    border-radius: 10px;
    background: #FFFFFF;
    color: #1F1B18;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kwsl-social-login .kwsl-btn:hover,
.kwsl-social-login .kwsl-btn:focus {
    border-color: #1F1B18;
    color: #1F1B18;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(31, 27, 24, 0.08);
}

.kwsl-social-login .kwsl-btn:focus-visible {
    outline: 2px solid #8A6A1F;
    outline-offset: 2px;
}

.kwsl-social-login .kwsl-btn:active {
    transform: scale(0.99);
}

.kwsl-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kwsl-btn-icon img {
    display: block;
    width: 20px;
    height: 20px;
}

/* Apple: black button with the logo in white (Apple's own guidelines) */
.kwsl-social-login .kwsl-btn-apple,
.kwsl-social-login .kwsl-btn-apple:hover,
.kwsl-social-login .kwsl-btn-apple:focus {
    background: #000000;
    border-color: #000000;
    color: #FFFFFF;
}

.kwsl-btn-apple .kwsl-btn-icon img {
    filter: invert(1);
}

/* Loading state set by kwsociallogin.js on click */
.kwsl-social-login .kwsl-btn.kwsl-loading {
    opacity: 0.75;
    pointer-events: none;
}

.kwsl-social-login .kwsl-btn.kwsl-loading .kwsl-btn-icon {
    width: 20px;
    height: 20px;
    border: 2px solid #CFC8BC;
    border-top-color: #8A6A1F;
    border-radius: 50%;
    box-sizing: border-box;
    animation: kwsl-spin 0.8s linear infinite;
}

.kwsl-social-login .kwsl-btn.kwsl-loading .kwsl-btn-icon img {
    display: none;
}

@keyframes kwsl-spin {
    to { transform: rotate(360deg); }
}

/* Reassurance line under the buttons */
.kwsl-social-login .kwsl-reassure {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1.45;
    color: #6B635B;
}

.kwsl-reassure svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #8A6A1F;
}

/* Separator between the social options and the email form */
.kwsl-separator {
    display: none;
}

.kwsl-top .kwsl-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 0;
}

.kwsl-top .kwsl-separator::before,
.kwsl-top .kwsl-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E2DBCF;
}

.kwsl-separator-text {
    font-size: 12px;
    font-weight: 500;
    color: #6B635B;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* Icon only style */
.kwsl-style-icon_only .kwsl-buttons-container {
    flex-direction: row;
    justify-content: center;
}

.kwsl-style-icon_only .kwsl-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
}

/* Messages */
.kwsl-messages {
    margin-top: 12px;
}

.kwsl-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.kwsl-alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B42318;
}

.kwsl-alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}
