@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
    --page-bg: radial-gradient(circle at 15% 20%, #09132a 0%, #020610 60%);
    --surface: rgba(11, 17, 30, 0.9);
    --surface-alt: rgba(255, 255, 255, 0.03);
    --highlight: #00d0ff;
    --accent: #f08d24;
    --text-primary: #f6f6f6;
    --text-muted: #b6c0d8;
    --border-color: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body.connexion-body {
    margin: 0;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    background: var(--page-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

body.connexion-body.profile-artisan {
    --highlight: #ffb84d;
    --accent: #ff7a1a;
    --page-bg: radial-gradient(circle at 12% 18%, #21170a 0%, #090603 62%);
}

body.connexion-body.profile-collaborateur {
    --highlight: #29f0c8;
    --accent: #6ad8ff;
    --page-bg: radial-gradient(circle at 14% 20%, #06211f 0%, #03100f 62%);
}

body.connexion-body.profile-client {
    --highlight: #58d0ff;
    --accent: #86f5d3;
    --page-bg: radial-gradient(circle at 16% 20%, #0a1830 0%, #030811 62%);
}

.top-login {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(2, 15, 26, 0.65);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    backdrop-filter: blur(6px);
    z-index: 999;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.top-login:hover {
    transform: translateY(-2px);
    border-color: var(--highlight);
}

.connexion-wrapper {
    width: min(1200px, 92vw);
    margin: 0 auto;
    padding: 5rem 0 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.login-panel,
.info-panel {
    background: var(--surface);
    border-radius: 28px;
    padding: 3rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
    animation: panel-enter 0.55s ease both;
}

.panel-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--highlight);
    font-size: 0.85rem;
    margin: 0 0 1rem;
}

.profile-signature {
    margin: -0.35rem 0 1rem;
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.tenant-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    margin: 0 auto 1.4rem;
    width: min(100%, 320px);
}

.tenant-branding img {
    max-width: min(260px, 100%);
    max-height: 84px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(8, 20, 38, 0.15);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.28));
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.tenant-branding img:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.tenant-branding-name {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

.tenant-branding-name--solo {
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.login-panel h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 0 0 0.75rem;
}

.panel-lead {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.form-stack label {
    font-weight: 600;
    font-size: 0.95rem;
}

.form-stack input {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.9rem 1rem;
    background: rgba(3, 9, 20, 0.6);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-stack input:focus {
    outline: none;
    border-color: rgba(0, 208, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 208, 255, 0.12);
    background: rgba(5, 12, 24, 0.85);
}

.form-stack input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    background-color: rgba(3, 15, 26, 0.7);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    transition: border-color 0.2s ease;
    padding: 0;
}

.toggle-password:hover {
    border-color: var(--highlight);
}

.toggle-password::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d0ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    background-position: center;
    background-size: 18px;
    background-repeat: no-repeat;
}

.toggle-password.visible::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d0ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cline x1='4' y1='4' x2='20' y2='20'/%3E%3C/svg%3E");
}

.cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.cta.primary {
    margin-top: 0.5rem;
    border: none;
    border-radius: 999px;
    padding: 1rem 1.8rem;
    background: linear-gradient(120deg, var(--highlight), #27e2b4);
    color: #031119;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 208, 255, 0.3);
}

.cta.primary.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cta.ghost {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.9rem 1.6rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.cta.ghost:hover {
    border-color: var(--highlight);
    transform: translateY(-2px);
}

.auth-alert {
    border-radius: 14px;
    border: 1px solid rgba(255, 87, 87, 0.5);
    background: rgba(255, 87, 87, 0.12);
    color: #ffd2d2;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
}

.auth-alert a {
    color: var(--highlight);
    font-weight: 600;
    text-decoration: none;
}

.panel-benefits {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    color: var(--text-muted);
}

.panel-benefits li::before {
    content: "•";
    color: var(--accent);
    margin-right: 0.5rem;
}

.help-block {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.2rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.help-block a {
    color: var(--highlight);
    text-decoration: none;
}

.secondary-link {
    font-weight: 600;
}

.info-card {
    background: var(--surface-alt);
    border-radius: 20px;
    padding: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
}

.info-grid article {
    background: var(--surface-alt);
    border-radius: 18px;
    padding: 1.3rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 150px;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.info-grid article:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 208, 255, 0.26);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.26);
}

.info-grid h3 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.info-grid p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.news-banner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(240, 141, 36, 0.1);
    border: 1px solid rgba(240, 141, 36, 0.3);
    border-radius: 18px;
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.5rem;
}

body.connexion-body.profile-artisan .news-banner {
    background: rgba(255, 122, 26, 0.14);
    border-color: rgba(255, 122, 26, 0.42);
}

body.connexion-body.profile-collaborateur .news-banner {
    background: rgba(106, 216, 255, 0.14);
    border-color: rgba(106, 216, 255, 0.42);
}

body.connexion-body.profile-client .news-banner {
    background: rgba(88, 208, 255, 0.14);
    border-color: rgba(88, 208, 255, 0.42);
}

.news-banner span {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--accent);
}

.news-banner p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

@keyframes panel-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .login-panel,
    .info-panel {
        padding: 2.2rem;
    }

    .connexion-wrapper {
        width: 94vw;
        padding: 4rem 0 2.5rem;
    }

    .top-login {
        right: 0.75rem;
    }
}