*, *::before, *::after { box-sizing: border-box; }

:root {
    --guest-navy: #0F2744;
    --guest-green: #03A625;
    --guest-green-dark: #028a1f;
    --guest-muted: #64748b;
    --guest-line: #DCEAF3;
    --guest-bg: #F5F7F9;
    --guest-white: #FFFFFF;
}

body.guest-body {
    margin: 0;
    min-height: 100vh;
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    color: var(--guest-navy);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background: var(--guest-navy);
}

.guest-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: var(--guest-navy);
    background-image:
        linear-gradient(180deg, rgb(15 39 68 / 0.55) 0%, rgb(15 39 68 / 0.72) 100%),
        var(--guest-bg-image);
    background-size: cover;
    background-position: center;
}

.guest-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
}

.guest-shell {
    width: 100%;
    max-width: 26.5rem;
    animation: guest-card-in 0.45s ease-out both;
}

.guest-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
    text-decoration: none;
}

.guest-brand img {
    display: block;
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
}

.guest-auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    padding: 0.3rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.12);
    backdrop-filter: blur(8px);
}

.guest-auth-switch a {
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgb(255 255 255 / 0.75);
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.guest-auth-switch a.is-active {
    background: var(--guest-white);
    color: var(--guest-navy);
}

/* Switcher Prestataire / Donneur d’ordre , dans la carte blanche */
.guest-auth-switch--role {
    width: 100%;
    margin: 0;
    background: var(--guest-navy);
    backdrop-filter: none;
}

.guest-auth-switch--role a {
    color: rgb(255 255 255 / 0.72);
    font-weight: 700;
}

.guest-auth-switch--role a:hover {
    color: var(--guest-white);
}

.guest-auth-switch--role a.is-active {
    background: var(--guest-white);
    color: var(--guest-navy);
}

.alert-success {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    background: rgb(3 166 37 / 0.14);
    color: #dcfce7;
    font-size: 0.875rem;
    border: 1px solid rgb(3 166 37 / 0.35);
}

.alert-error {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
}

.card {
    background: var(--guest-white);
    border-radius: 1.25rem;
    padding: 1.75rem 1.5rem 1.5rem;
    border: 1px solid rgb(255 255 255 / 0.35);
    box-shadow: 0 24px 60px rgb(0 0 0 / 0.28);
}

.card > * + * { margin-top: 1rem; }

.auth-heading {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--guest-navy);
    text-align: center;
}

.auth-sub {
    margin: 0.35rem 0 0;
    text-align: center;
    color: var(--guest-muted);
    font-size: 0.95rem;
}

.auth-method-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    padding: 0.3rem;
    border-radius: 0.85rem;
    background: var(--guest-bg);
    border: 1px solid var(--guest-line);
}

.auth-method-tabs a {
    text-align: center;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--guest-muted);
    padding: 0.55rem 0.25rem;
    border-radius: 0.65rem;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-method-tabs a.is-active {
    background: var(--guest-white);
    color: var(--guest-navy);
    box-shadow: 0 1px 3px rgb(15 39 68 / 0.1);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 420px) {
    .field-row { grid-template-columns: 1fr; }
}

.hint { margin: 0; font-size: 0.875rem; color: var(--guest-muted); }

.field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--guest-navy);
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"],
.field .password-input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--guest-line);
    border-radius: 0.65rem;
    font-size: 0.95rem;
    background: #fff;
    color: var(--guest-navy);
}

.field input:focus,
.field .password-input:focus {
    outline: 2px solid color-mix(in srgb, var(--guest-green) 35%, transparent);
    border-color: color-mix(in srgb, var(--guest-green) 50%, var(--guest-line));
}

.password-wrap { position: relative; }
.password-wrap .password-input { padding-right: 2.75rem; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 0.25rem;
    background: transparent;
    color: var(--guest-muted);
    cursor: pointer;
}
.password-toggle:hover {
    color: var(--guest-navy);
    background: var(--guest-line);
}
.password-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
}

.error { margin: 0.25rem 0 0; font-size: 0.875rem; color: #dc2626; }
.checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }

.auth-password-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 1rem;
}
.auth-forgot-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--guest-navy);
    text-decoration: none;
}
.auth-forgot-link:hover { text-decoration: underline; }

.btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--guest-green);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}
.btn:hover { background: var(--guest-green-dark); }
.btn:disabled { opacity: 0.7; cursor: wait; }

.btn-secondary {
    background: transparent;
    color: var(--guest-navy);
    border: 1px solid var(--guest-line);
}

.btn-secondary:hover {
    background: var(--guest-bg);
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--guest-line);
    background: #fff;
    color: var(--guest-navy);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}
.btn-google:hover { background: var(--guest-bg); }
.btn-google svg { width: 1.15rem; height: 1.15rem; }

.footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--guest-muted);
}
.footer a {
    color: var(--guest-navy);
    font-weight: 600;
}

.auth-legal {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--guest-muted);
}
.auth-legal a {
    color: var(--guest-navy);
    font-weight: 600;
}

@keyframes guest-card-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
