:root {
    --brand-green: #78b82a;
    --brand-green-dark: #639a20;
    --brand-green-soft: #eef6e5;

    --charcoal: #25282a;
    --text: #34383b;
    --text-soft: #6b7174;

    --background: #f4f5f4;
    --surface: #ffffff;

    --border: #dfe3df;
    --border-strong: #c9cfca;

    --success: #57951c;
    --success-soft: #edf7e5;

    --error: #b3261e;
    --error-soft: #fcebea;

    --shadow:
        0 16px 40px rgba(25, 30, 25, 0.09),
        0 2px 7px rgba(25, 30, 25, 0.04);

    --radius-large: 20px;
    --radius-medium: 11px;

    --font:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}


* {
    box-sizing: border-box;
}


html {
    min-height: 100%;
}


body {
    margin: 0;
    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #f8f9f7 0%,
            var(--background) 55%,
            #eef1ed 100%
        );

    color: var(--text);

    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* CABECERA */

.site-header {
    width: 100%;

    background: var(--charcoal);
    border-bottom: 4px solid var(--brand-green);
}


.header-inner {
    width: min(1120px, calc(100% - 36px));
    min-height: 78px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}


.brand-logo {
    display: block;

    width: auto;
    max-width: 215px;
    max-height: 52px;
}


.language-switch {
    display: flex;
    align-items: center;

    gap: 4px;

    flex-shrink: 0;

    font-size: 13px;
    font-weight: 750;
    letter-spacing: 0.05em;
}


.language-switch a,
.language-switch span {
    min-width: 36px;

    padding: 6px 7px;

    border-radius: 6px;

    text-align: center;
    text-decoration: none;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}


.language-switch a {
    color: #d9dcda;
}


.language-switch a:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}


.language-switch .active {
    background: var(--brand-green);
    color: #ffffff;
}


/* CONTENIDO */

.page {
    width: min(780px, calc(100% - 32px));

    margin: 28px auto;
}


.card {
    overflow: hidden;

    background: var(--surface);

    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow);
}


.card-body {
    padding: 32px 40px 36px;
}


.page-title {
    margin: 0 0 5px;

    color: var(--charcoal);

    font-size: clamp(1.7rem, 4vw, 2.15rem);
    font-weight: 760;
    line-height: 1.12;
    letter-spacing: -0.035em;
}


.page-intro {
    margin: 0 0 24px;

    color: var(--text-soft);

    font-size: 0.94rem;
}


/* MENSAJES */

.alert {
    margin: 0 0 20px;

    padding: 12px 14px;

    border-radius: var(--radius-medium);

    font-size: 0.91rem;
    line-height: 1.42;
}


.alert-error {
    background: var(--error-soft);

    border-left: 4px solid var(--error);

    color: #7f211b;
}


.alert-success {
    background: var(--success-soft);

    border-left: 4px solid var(--success);

    color: #35670e;
}


/* FORMULARIO */

.form-group {
    margin-bottom: 15px;
}


.form-label {
    display: block;

    margin-bottom: 5px;

    color: var(--charcoal);

    font-size: 0.88rem;
    font-weight: 680;
}


.form-control {
    width: 100%;
    min-height: 46px;

    padding: 9px 13px;

    appearance: none;

    background: #ffffff;

    border: 1px solid var(--border-strong);
    border-radius: var(--radius-medium);

    color: var(--text);
    font: inherit;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.form-control:hover {
    border-color: #aeb6af;
}


.form-control:focus {
    border-color: var(--brand-green);

    box-shadow:
        0 0 0 4px rgba(120, 184, 42, 0.14);
}


/* CONTRASEÑAS */

.password-wrap {
    position: relative;
}


.password-wrap .form-control {
    padding-right: 54px;
}


/* OJO */

.toggle-password {
    position: absolute;

    top: 50%;
    right: 7px;

    width: 38px;
    height: 38px;

    padding: 0;

    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;

    border: 0;
    border-radius: 50%;

    color: #747d77;

    cursor: pointer;

    user-select: none;
    touch-action: none;

    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        transform 0.08s ease;
}


.toggle-password:hover {
    background: #f0f3ef;
    color: var(--brand-green-dark);
}


.toggle-password:active {
    transform:
        translateY(-50%)
        scale(0.95);
}


.toggle-password:focus-visible {
    outline: 2px solid rgba(120, 184, 42, 0.45);
    outline-offset: 1px;
}


.toggle-password.is-visible {
    background: var(--brand-green-soft);
    color: var(--brand-green-dark);
}


.eye-icon {
    width: 20px;
    height: 20px;

    display: block;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}


/* Oculta el ojo normal cuando la clave está oculta */

.icon-eye {
    display: none;
}


/* Por defecto mostramos el ojo tachado */

.icon-eye-off {
    display: block;
}


/* Mientras se mantiene pulsado:
   mostramos ojo normal */

.toggle-password.is-visible .icon-eye {
    display: block;
}


.toggle-password.is-visible .icon-eye-off {
    display: none;
}


/* REQUISITOS */

.requirements {
    margin: 22px 0 23px;

    padding: 18px 21px;

    background: #f8f9f7;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
}


.requirements-title {
    margin: 0 0 12px;

    color: var(--charcoal);

    font-size: 0.96rem;
    font-weight: 750;
}


.requirements-list {
    display: grid;

    gap: 7px;

    margin: 0;
    padding: 0;

    list-style: none;
}


.requirement {
    display: grid;

    grid-template-columns: 23px 1fr;

    gap: 8px;

    align-items: start;

    color: var(--text);

    font-size: 0.85rem;
    line-height: 1.35;
}


.requirement .estado,
.requirement .info-icon {
    width: 23px;

    text-align: center;
    line-height: 1.35;
}


.requirement:not(.requirement-info) {
    color: var(--charcoal);
    font-weight: 520;
}


.requirement-info {
    color: var(--text-soft);
}


/* BOTONES */

.primary-button,
.return-button {
    min-height: 49px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 11px 22px;

    border: 0;
    border-radius: var(--radius-medium);

    background: var(--brand-green);

    color: #ffffff;

    font-family: var(--font);
    font-size: 0.94rem;
    font-weight: 750;

    text-align: center;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        transform 0.08s ease,
        box-shadow 0.15s ease;
}


.primary-button {
    width: 100%;
}


.primary-button:hover,
.return-button:hover {
    background: var(--brand-green-dark);

    box-shadow:
        0 7px 18px rgba(99, 154, 32, 0.20);
}


.primary-button:active,
.return-button:active {
    transform: translateY(1px);
}


.primary-button:focus-visible,
.return-button:focus-visible {
    outline: 3px solid rgba(120, 184, 42, 0.35);
    outline-offset: 3px;
}


/* PANTALLA DE ÉXITO */

.success-card .card-body {
    padding-top: 48px;
    padding-bottom: 48px;

    text-align: center;
}


.success-icon {
    width: 70px;
    height: 70px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--success-soft);

    border: 2px solid rgba(87, 149, 28, 0.22);
    border-radius: 50%;

    color: var(--success);

    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}


.success-title {
    margin: 0 0 10px;

    color: var(--charcoal);

    font-size: clamp(1.6rem, 4vw, 2.05rem);
    font-weight: 760;
    line-height: 1.16;
    letter-spacing: -0.03em;
}


.success-text {
    max-width: 460px;

    margin: 0 auto 26px;

    color: var(--text-soft);

    font-size: 0.96rem;
}


.return-button {
    min-width: 210px;
}


/* PIE */

.site-footer {
    width: min(780px, calc(100% - 32px));

    margin: -8px auto 24px;

    color: #858a86;

    font-size: 0.75rem;
    text-align: center;
}


/* TABLET / MÓVIL */

@media (max-width: 640px) {
    .header-inner {
        width: calc(100% - 26px);
        min-height: 70px;

        gap: 10px;
    }


    .brand-logo {
        max-width: 180px;
        max-height: 45px;
    }


    .language-switch {
        font-size: 12px;
        gap: 2px;
    }


    .language-switch a,
    .language-switch span {
        min-width: 32px;

        padding: 6px 5px;
    }


    .page {
        width: calc(100% - 20px);

        margin: 20px auto 28px;
    }


    .card {
        border-radius: 16px;
    }


    .card-body {
        padding: 25px 18px 27px;
    }


    .page-title {
        font-size: 1.65rem;
    }


    .page-intro {
        margin-bottom: 22px;
    }


    .form-group {
        margin-bottom: 16px;
    }


    .form-control {
        min-height: 50px;

        font-size: 16px;
    }


    .toggle-password {
        width: 42px;
        height: 42px;

        right: 5px;
    }


    .eye-icon {
        width: 21px;
        height: 21px;
    }


    .requirements {
        margin: 23px 0;

        padding: 17px 15px;
    }


    .requirements-list {
        gap: 9px;
    }


    .requirement {
        grid-template-columns: 22px 1fr;

        gap: 7px;

        font-size: 0.87rem;
    }


    .primary-button {
        min-height: 52px;
    }


    .success-card .card-body {
        padding-top: 40px;
        padding-bottom: 40px;
    }


    .success-icon {
        width: 65px;
        height: 65px;

        font-size: 33px;
    }


    .return-button {
        width: 100%;
    }


    .site-footer {
        width: calc(100% - 20px);
    }
}


/* MÓVILES MUY PEQUEÑOS */

@media (max-width: 380px) {
    .header-inner {
        width: calc(100% - 18px);
    }


    .brand-logo {
        max-width: 155px;
    }


    .language-switch a,
    .language-switch span {
        min-width: 29px;

        padding-left: 3px;
        padding-right: 3px;
    }


    .card-body {
        padding-left: 15px;
        padding-right: 15px;
    }


    .requirements {
        padding-left: 13px;
        padding-right: 13px;
    }
}

/* CONSTRUCTOR DE CORREO */

.email-builder {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        auto
        minmax(235px, auto);
    grid-template-areas: "user at domains";
    align-items: center;
    gap: 12px;
}


.email-user {
    grid-area: user;
    min-width: 0;
}


.email-at {
    grid-area: at;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--charcoal);

    font-size: 1.12rem;
    font-weight: 760;
    line-height: 1;

    user-select: none;
}


.domain-options {
    grid-area: domains;

    min-width: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 6px;
}


.domain-option {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 30px;

    gap: 16px;

    color: #aeb4af;

    cursor: pointer;

    transition:
        color 0.15s ease,
        opacity 0.15s ease;
}


.domain-option span {
    order: 1;

    font-size: 0.87rem;
    font-weight: 560;
    line-height: 1.25;

    transition:
        color 0.15s ease,
        font-weight 0.15s ease;
}


.domain-option input {
    order: 2;

    width: 18px;
    height: 18px;

    margin: 0;

    flex: 0 0 auto;

    accent-color: var(--brand-green);

    cursor: pointer;
}


.domain-option:hover {
    color: #6f7671;
}


/* Cuando todavía no se ha elegido ningún dominio,
   ambos aparecen suaves y con el mismo peso visual. */

.domain-options:not(:has(input:checked)) .domain-option {
    color: #aeb4af;
}


/* Cuando ya hay una elección, la opción no seleccionada
   queda claramente atenuada, aunque sigue siendo pulsable. */

.domain-options:has(input:checked) .domain-option {
    color: #b9beb9;
}


/* La opción seleccionada destaca de forma clara. */

.domain-options .domain-option:has(input:checked) {
    color: var(--charcoal);
}


.domain-options .domain-option:has(input:checked) span {
    font-weight: 760;
}


.domain-option input:focus-visible {
    outline: 3px solid rgba(120, 184, 42, 0.32);
    outline-offset: 2px;
}


@media (max-width: 640px) {
    .email-builder {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "user user"
            "at domains";

        gap: 8px 10px;
    }


    .email-at {
        align-self: center;

        padding-left: 2px;
    }


    .domain-options {
        gap: 7px;
    }


    .domain-option {
        min-height: 31px;
    }


    .domain-option span {
        font-size: 0.89rem;
    }
}
