/*
 * Personalización principal.
 * Cambia --elm-primary para ajustar el verde de la marca.
 */
.elmanjar-auth-page {
    --elm-primary: #2f6f3e;
    --elm-primary-dark: #245832;
    --elm-primary-soft: #edf5ef;
    --elm-text: #20231f;
    --elm-muted: #6d746d;
    --elm-border: #dfe5df;
    --elm-surface: #ffffff;
    --elm-page: #f6f7f3;
    --elm-danger: #b42318;
    --elm-radius-lg: 24px;
    --elm-radius-md: 14px;
    --elm-shadow: 0 22px 60px rgba(28, 45, 31, 0.12);
}

.elmanjar-auth-page .woocommerce {
    overflow: visible;
}

.elm-auth-shell,
.elm-auth-shell * {
    box-sizing: border-box;
}

.elm-auth-shell {
    width: min(100%, 620px);
    margin: 34px auto 60px;
    color: var(--elm-text);
}

.elm-auth-card {
    position: relative;
    overflow: hidden;
    background: var(--elm-surface);
    border: 1px solid var(--elm-border);
    border-radius: var(--elm-radius-lg);
    box-shadow: var(--elm-shadow);
}

.elm-auth-card::before {
    content: "";
    display: block;
    height: 6px;
    background: var(--elm-primary);
}

.elm-auth-header {
    padding: 34px 38px 24px;
    text-align: center;
}

.elm-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 12px;
    margin-bottom: 12px;
    color: var(--elm-primary-dark);
    background: var(--elm-primary-soft);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.elm-auth-title {
    margin: 0;
    color: var(--elm-text);
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 750;
    line-height: 1.15;
}

.elm-auth-description {
    max-width: 470px;
    margin: 12px auto 0;
    color: var(--elm-muted);
    font-size: 15px;
    line-height: 1.65;
}

.elm-auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0 38px;
    padding: 5px;
    background: #f0f2ee;
    border: 1px solid var(--elm-border);
    border-radius: 14px;
}

.elm-auth-tab {
    appearance: none;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    margin: 0;
    color: var(--elm-muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.elm-auth-tab:hover {
    color: var(--elm-primary-dark);
    background: rgba(255, 255, 255, 0.55);
}

.elm-auth-tab.is-active {
    color: var(--elm-primary-dark);
    background: var(--elm-surface);
    box-shadow: 0 5px 16px rgba(27, 50, 32, 0.09);
}

.elm-auth-tab:focus-visible,
.elm-password-toggle:focus-visible,
.elm-auth-shell a:focus-visible,
.elm-auth-shell button:focus-visible,
.elm-auth-shell input:focus-visible {
    outline: 3px solid rgba(47, 111, 62, 0.24);
    outline-offset: 2px;
}

.elm-auth-panels {
    padding: 30px 38px 34px;
}

/* Sin JavaScript se muestran ambos formularios; con JS solo el tab activo. */
.elm-js .elm-auth-panel {
    display: none;
}

.elm-js .elm-auth-panel.is-active {
    display: block;
    animation: elm-auth-panel-in 180ms ease both;
}

@keyframes elm-auth-panel-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .elm-js .elm-auth-panel.is-active {
        animation: none;
    }

    .elm-auth-tab,
    .elm-auth-shell input,
    .elm-auth-shell button {
        transition: none;
    }
}

.elm-panel-title {
    margin: 0;
    color: var(--elm-text);
    font-size: 22px;
    font-weight: 750;
    line-height: 1.25;
}

.elm-panel-intro {
    margin: 7px 0 24px;
    color: var(--elm-muted);
    font-size: 14px;
    line-height: 1.55;
}

.elm-auth-shell .woocommerce-form {
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.elm-auth-shell .form-row {
    float: none;
    width: 100%;
    padding: 0;
    margin: 0 0 18px;
}

.elm-auth-shell .form-row label:not(.woocommerce-form__label-for-checkbox) {
    display: block;
    margin: 0 0 7px;
    color: var(--elm-text);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
}

.elm-auth-shell .required {
    color: var(--elm-danger);
    text-decoration: none;
}

.elm-auth-shell input[type="text"],
.elm-auth-shell input[type="email"],
.elm-auth-shell input[type="password"] {
    appearance: none;
    width: 100%;
    height: 52px;
    padding: 0 15px;
    margin: 0;
    color: var(--elm-text);
    background: #fff;
    border: 1px solid var(--elm-border);
    border-radius: var(--elm-radius-md);
    box-shadow: 0 1px 2px rgba(25, 39, 28, 0.02);
    font: inherit;
    font-size: 16px;
    line-height: 1;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.elm-auth-shell input[type="text"]:hover,
.elm-auth-shell input[type="email"]:hover,
.elm-auth-shell input[type="password"]:hover {
    border-color: #b8c4b9;
}

.elm-auth-shell input[type="text"]:focus,
.elm-auth-shell input[type="email"]:focus,
.elm-auth-shell input[type="password"]:focus {
    background: #fff;
    border-color: var(--elm-primary);
    box-shadow: 0 0 0 4px rgba(47, 111, 62, 0.1);
    outline: none;
}

.elm-password-field {
    position: relative;
    display: block;
}

.elm-password-field input {
    padding-right: 52px !important;
}

.elm-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    color: var(--elm-muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
    cursor: pointer;
    transform: translateY(-50%);
}

.elm-password-toggle:hover {
    color: var(--elm-primary-dark);
    background: var(--elm-primary-soft);
}

.elm-eye-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 14px;
    border: 1.8px solid currentColor;
    border-radius: 65% 35% / 65% 35%;
    transform: rotate(45deg);
}

.elm-eye-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.elm-password-toggle[aria-pressed="true"] .elm-eye-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -3px;
    width: 25px;
    height: 2px;
    background: currentColor;
    transform: rotate(-90deg);
}

.elm-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -2px 0 22px;
}

.elm-auth-shell .woocommerce-form-login__rememberme {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--elm-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.elm-auth-shell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--elm-primary);
}

.elm-lost-password {
    color: var(--elm-primary-dark);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.elm-lost-password:hover {
    color: var(--elm-primary);
    text-decoration: underline;
}

.elm-submit-row {
    margin: 0 !important;
}

.elm-auth-shell .woocommerce-button.button,
.elm-auth-shell .woocommerce-Button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 13px 22px;
    margin: 0;
    color: #fff;
    background: var(--elm-primary);
    border: 1px solid var(--elm-primary);
    border-radius: var(--elm-radius-md);
    box-shadow: 0 10px 22px rgba(47, 111, 62, 0.18);
    font: inherit;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.elm-auth-shell .woocommerce-button.button:hover,
.elm-auth-shell .woocommerce-Button.button:hover {
    color: #fff;
    background: var(--elm-primary-dark);
    border-color: var(--elm-primary-dark);
    box-shadow: 0 12px 26px rgba(36, 88, 50, 0.23);
    transform: translateY(-1px);
}

.elm-auth-shell .woocommerce-button.button:active,
.elm-auth-shell .woocommerce-Button.button:active {
    transform: translateY(0);
}

.elm-password-notice,
.elm-auth-shell .woocommerce-privacy-policy-text {
    padding: 13px 15px;
    margin: 0 0 18px;
    color: var(--elm-muted);
    background: var(--elm-primary-soft);
    border: 1px solid #d8e8db;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
}

.elm-auth-shell .woocommerce-privacy-policy-text p {
    margin: 0;
}

.elm-auth-shell .woocommerce-privacy-policy-text a {
    color: var(--elm-primary-dark);
    font-weight: 650;
}

.elm-auth-footer {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 16px 28px;
    color: var(--elm-muted);
    background: #fafbf8;
    border-top: 1px solid var(--elm-border);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.elm-auth-footer > span {
    flex: 0 0 auto;
    color: var(--elm-primary);
    font-weight: 800;
}

/* Avisos de WooCommerce cerca del formulario. */
.elmanjar-auth-page .woocommerce-notices-wrapper,
.elmanjar-auth-page > .woocommerce-error,
.elmanjar-auth-page > .woocommerce-message,
.elmanjar-auth-page > .woocommerce-info {
    width: min(100%, 620px);
    margin-right: auto;
    margin-left: auto;
}

.elmanjar-auth-page .woocommerce-error,
.elmanjar-auth-page .woocommerce-message,
.elmanjar-auth-page .woocommerce-info {
    border-radius: 12px;
}

@media (max-width: 640px) {
    .elm-auth-shell {
        width: 100%;
        margin: 18px auto 38px;
        padding: 0 12px;
    }

    .elm-auth-card {
        border-radius: 18px;
    }

    .elm-auth-header {
        padding: 28px 22px 20px;
    }

    .elm-auth-tabs {
        margin: 0 20px;
    }

    .elm-auth-panels {
        padding: 26px 22px 28px;
    }

    .elm-login-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .elm-auth-footer {
        padding-right: 20px;
        padding-left: 20px;
    }
}

@media (max-width: 380px) {
    .elm-auth-tab {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 13px;
    }
}
