
        /* ===== RESET & BASE ===== */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
        }

        :root {
            --green: #16a34a;
            --green-dark: #15803d;
            --green-soft: #dcfce7;
            --text: #0f172a;
            --muted: #64748b;
            --border: #e2e8f0;
            --bg: #f8fafc;
            --white: #ffffff;
            --shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
            --radius-card: 28px;
            --radius-field: 16px;
            --radius-pill: 999px;
        }

        html,
        body {
            width: 100%;
            min-width: 0;
            margin: 0;
            padding: 0;
            overflow-x: hidden;
            -webkit-text-size-adjust: 100%;
            -moz-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }

        body {
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background:
                radial-gradient(circle at top left, rgba(22, 163, 74, 0.12), transparent 34%),
                radial-gradient(circle at bottom right, rgba(21, 128, 61, 0.14), transparent 36%),
                var(--bg);
            color: var(--text);
            line-height: 1.5;
        }

        /* ===== LAYOUT : MOBILE-FIRST (single column) ===== */
        .register-page {
            width: 100%;
            max-width: 100vw;
            min-height: 100vh;
            min-height: 100dvh;
            display: block;
            padding: 0;
            margin: 0;
        }

        /* ---- left panel : hidden on mobile ---- */
        .register-left {
            display: none;
        }

        /* ---- right panel : full width on mobile ---- */
        .register-right {
            width: 100%;
            min-height: 100vh;
            min-height: 100dvh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px 12px;
            background: rgba(255, 255, 255, 0.72);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
        }

        /* ---- card ---- */
        .register-card {
            width: 100%;
            max-width: 520px;
            margin: 0 auto;
            background: var(--white);
            border: 1px solid rgba(226, 232, 240, 0.9);
            border-radius: var(--radius-card);
            padding: 28px 20px 32px;
            box-shadow: var(--shadow);
            transition: padding 0.25s ease;
        }

        /* ===== TYPOGRAPHY (mobile-optimized) ===== */
        .register-logo {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
            color: var(--text);
            margin-bottom: 20px;
        }

        .register-logo-mark {
            width: 44px;
            height: 44px;
            border-radius: 16px;
            display: grid;
            place-items: center;
            background: linear-gradient(135deg, var(--green), var(--green-dark));
            color: #fff;
            box-shadow: 0 10px 24px rgba(22, 163, 74, 0.28);
            flex-shrink: 0;
        }

        .register-logo-mark i {
            font-size: 1.2rem;
        }

        .register-logo strong {
            font-size: 1.2rem;
            font-weight: 900;
            letter-spacing: -0.03em;
        }

        .register-card h2 {
            margin: 0;
            font-size: clamp(1.8rem, 6vw, 2.6rem);
            line-height: 1.05;
            font-weight: 900;
            letter-spacing: -0.06em;
        }

        .register-subtitle {
            margin: 12px 0 20px;
            color: var(--muted);
            line-height: 1.6;
            font-size: 0.95rem;
            font-weight: 500;
        }

        /* ===== ALERT ===== */
        .register-alert {
            display: none;
            margin-bottom: 14px;
            padding: 12px 14px;
            border-radius: 14px;
            font-weight: 700;
            font-size: 0.88rem;
            line-height: 1.4;
        }

        .register-alert.show {
            display: block;
        }

        .register-alert.error {
            background: #fee2e2;
            color: #991b1b;
            border: 1px solid #fecaca;
        }

        .register-alert.success {
            background: #dcfce7;
            color: #166534;
            border: 1px solid #bbf7d0;
        }

        /* ===== FORM ===== */
        .register-form {
            display: grid;
            gap: 14px;
            width: 100%;
            min-width: 0;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr;
            gap: 14px;
            min-width: 0;
        }

        .form-field {
            display: grid;
            gap: 6px;
            min-width: 0;
        }

        .form-field label {
            font-size: 0.85rem;
            font-weight: 800;
            color: #334155;
            letter-spacing: -0.01em;
        }

        /* --- inputs & selects --- */
        .form-field input,
        .form-field select {
            width: 100%;
            min-width: 0;
            height: 52px;
            border: 1.5px solid var(--border);
            border-radius: var(--radius-field);
            padding: 0 14px;
            font-family: inherit;
            font-size: 1rem;
            /* 16px minimum → no iOS zoom */;
            font-weight: 600;
            color: var(--text);
            background: #f8fafc;
            outline: none;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
            -webkit-appearance: none;
            appearance: none;
        }

        .form-field select {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 14px center;
            padding-right: 40px;
        }

        .form-field input:focus,
        .form-field select:focus {
            border-color: rgba(22, 163, 74, 0.6);
            background: #fff;
            box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
        }

        /* --- phone --- */
        .phone-input-wrap {
            width: 100%;
            min-width: 0;
            display: flex;
            align-items: center;
            height: 52px;
            border: 1.5px solid var(--border);
            border-radius: var(--radius-field);
            background: #f8fafc;
            overflow: hidden;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .phone-input-wrap:focus-within {
            border-color: rgba(22, 163, 74, 0.6);
            background: #fff;
            box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
        }

        .phone-code {
            height: 100%;
            min-width: 68px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 12px;
            background: #ecfdf3;
            color: var(--green-dark);
            font-weight: 900;
            font-size: 0.9rem;
            border-right: 1.5px solid var(--border);
            flex-shrink: 0;
            user-select: none;
        }

        .phone-input-wrap input {
            flex: 1;
            min-width: 0;
            height: 100% !important;
            border: 0 !important;
            box-shadow: none !important;
            background: transparent !important;
            border-radius: 0 !important;
            font-size: 1rem !important;
        }

        /* --- password --- */
        .password-wrap {
            position: relative;
            width: 100%;
            min-width: 0;
        }

        .password-wrap input {
            width: 100%;
            padding-right: 52px !important;
        }

        .password-toggle {
            position: absolute;
            top: 50%;
            right: 8px;
            transform: translateY(-50%);
            width: 40px;
            height: 40px;
            border: 0;
            border-radius: 12px;
            background: transparent;
            color: #64748b;
            cursor: pointer;
            z-index: 20;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s ease, color 0.2s ease;
            -webkit-tap-highlight-color: transparent;
        }

        .password-toggle:hover {
            background: #ecfdf3;
            color: #15803d;
        }

        .password-toggle:active {
            background: #d1fae5;
        }

        .password-toggle i {
            font-size: 1.1rem;
            line-height: 1;
            pointer-events: none;
        }

        /* ===== ROLE SWITCH ===== */
        .role-switch {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            min-width: 0;
            margin-bottom: 2px;
        }

        .role-option {
            position: relative;
            min-width: 0;
        }

        .role-option input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .role-box {
            min-height: 72px;
            border: 1.5px solid var(--border);
            border-radius: 18px;
            padding: 12px 14px;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            background: #fff;
            transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
        }

        .role-box i {
            width: 40px;
            height: 40px;
            border-radius: 14px;
            display: grid;
            place-items: center;
            background: #f0fdf4;
            color: var(--green-dark);
            flex-shrink: 0;
            font-size: 1.1rem;
        }

        .role-box strong {
            display: block;
            color: var(--text);
            font-weight: 900;
            font-size: 0.95rem;
        }

        .role-box span span {
            display: block;
            margin-top: 1px;
            color: var(--muted);
            font-size: 0.75rem;
            font-weight: 700;
            line-height: 1.2;
        }

        .role-option input:checked+.role-box {
            border-color: rgba(22, 163, 74, 0.55);
            background: #f0fdf4;
            box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.08);
        }

        /* ===== CHECKBOX ===== */
        .register-check {
            display: flex;
            gap: 10px;
            color: var(--muted);
            font-size: 0.85rem;
            line-height: 1.55;
            font-weight: 600;
            align-items: flex-start;
        }

        .register-check input {
            margin-top: 3px;
            accent-color: var(--green);
            width: 18px;
            height: 18px;
            flex-shrink: 0;
            cursor: pointer;
        }

        .register-check a {
            color: var(--green-dark);
            font-weight: 900;
            text-decoration: none;
        }

        .register-check a:hover {
            text-decoration: underline;
        }

        /* ===== BUTTON ===== */
        .register-btn {
            width: 100%;
            height: 56px;
            border: 0;
            border-radius: 18px;
            margin-top: 4px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-family: inherit;
            font-size: 1.05rem;
            font-weight: 900;
            color: #fff;
            background: linear-gradient(135deg, var(--green), var(--green-dark));
            cursor: pointer;
            box-shadow: 0 14px 30px rgba(22, 163, 74, 0.30);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
        }

        .register-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 18px 36px rgba(22, 163, 74, 0.38);
        }

        .register-btn:active {
            transform: translateY(0);
            box-shadow: 0 8px 20px rgba(22, 163, 74, 0.26);
        }

        .register-btn:disabled {
            opacity: 0.65;
            cursor: not-allowed;
            transform: none !important;
            box-shadow: 0 8px 20px rgba(22, 163, 74, 0.16);
        }

        /* ===== FOOTER ===== */
        .register-footer {
            margin-top: 22px;
            padding-top: 18px;
            border-top: 1px solid var(--border);
            text-align: center;
            color: var(--muted);
            font-size: 0.92rem;
            font-weight: 600;
            line-height: 1.5;
        }

        .register-footer a {
            color: var(--green-dark);
            font-weight: 900;
            text-decoration: none;
        }

        .register-footer a:hover {
            text-decoration: underline;
        }

        /* ============================================================
               TABLET / DESKTOP (min-width: 820px)
               ============================================================ */
        @media (min-width: 820px) {
            .register-page {
                display: grid;
                grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
                gap: 24px;
                padding: 24px;
                min-height: 100vh;
            }

            /* --- left panel --- */
            .register-left {
                display: flex;
                align-items: flex-end;
                position: relative;
                min-height: calc(100vh - 48px);
                border-radius: 34px;
                overflow: hidden;
                background:
                    linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(21, 128, 61, 0.82)),
                    url('https://images.unsplash.com/photo-1621905252507-b35492cc74b4?auto=format&fit=crop&w=1400&q=80') center/cover;
                color: #fff;
                padding: 44px 40px;
            }

            .register-left::before {
                content: "";
                position: absolute;
                inset: 0;
                background:
                    radial-gradient(circle at 22% 20%, rgba(34, 197, 94, 0.34), transparent 30%),
                    linear-gradient(to top, rgba(15, 23, 42, 0.90), transparent 56%);
                pointer-events: none;
            }

            .register-left-content {
                position: relative;
                z-index: 1;
                max-width: 620px;
            }

            .register-badge {
                display: inline-flex;
                align-items: center;
                gap: 9px;
                padding: 9px 14px;
                border-radius: var(--radius-pill);
                background: rgba(255, 255, 255, 0.14);
                border: 1px solid rgba(255, 255, 255, 0.20);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                font-size: 0.82rem;
                font-weight: 800;
                margin-bottom: 20px;
            }

            .register-left h1 {
                margin: 0;
                font-size: clamp(2.2rem, 4vw, 4.2rem);
                line-height: 0.98;
                letter-spacing: -0.07em;
                font-weight: 900;
            }

            .register-left p {
                margin: 18px 0 24px;
                max-width: 540px;
                color: rgba(255, 255, 255, 0.88);
                line-height: 1.75;
                font-size: 1.02rem;
                font-weight: 500;
            }

            .register-features {
                display: flex;
                flex-wrap: wrap;
                gap: 10px;
            }

            .register-feature {
                display: inline-flex;
                align-items: center;
                gap: 8px;
                padding: 10px 14px;
                border-radius: var(--radius-pill);
                background: rgba(255, 255, 255, 0.13);
                border: 1px solid rgba(255, 255, 255, 0.16);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                color: rgba(255, 255, 255, 0.94);
                font-weight: 800;
                font-size: 0.9rem;
                line-height: 1.25;
                letter-spacing: -0.01em;
            }

            .register-feature i {
                color: #86efac;
            }

            /* --- right panel --- */
            .register-right {
                display: flex;
                align-items: center;
                justify-content: center;
                background: rgba(255, 255, 255, 0.60);
                border: 1px solid rgba(226, 232, 240, 0.85);
                backdrop-filter: blur(18px);
                -webkit-backdrop-filter: blur(18px);
                border-radius: 34px;
                padding: 32px;
                min-height: calc(100vh - 48px);
            }

            .register-card {
                padding: 34px 32px 36px;
                max-width: 540px;
                border-radius: 30px;
            }

            /* --- form rows become 2 columns --- */
            .form-row {
                grid-template-columns: 1fr 1fr;
                gap: 16px;
            }

            .role-switch {
                gap: 14px;
            }

            .role-box {
                min-height: 80px;
                padding: 14px 16px;
            }

            .role-box i {
                width: 44px;
                height: 44px;
                font-size: 1.2rem;
            }

            .role-box strong {
                font-size: 1rem;
            }

            .role-box span span {
                font-size: 0.78rem;
            }

            .form-field input,
            .form-field select,
            .phone-input-wrap {
                height: 54px;
            }

            .register-btn {
                height: 58px;
                font-size: 1.05rem;
            }

            .register-card h2 {
                font-size: clamp(2rem, 3.4vw, 2.8rem);
            }
        }

        /* ============================================================
               LARGE DESKTOP (min-width: 1200px)
               ============================================================ */
        @media (min-width: 1200px) {
            .register-page {
                gap: 28px;
                padding: 28px;
            }

            .register-left {
                padding: 48px 44px;
            }

            .register-right {
                padding: 36px;
            }

            .register-card {
                padding: 38px 36px 40px;
                max-width: 580px;
            }
        }

        /* ============================================================
               ACCESSIBILITY : reduced motion
               ============================================================ */
        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                transition-duration: 0.01ms !important;
                animation-duration: 0.01ms !important;
            }
        }

        /* ============================================================
               UTILITY : screen-reader only
               ============================================================ */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
   /* ===== MOBILE FIX : ensure register footer is fully visible ===== */
@media (max-width: 819px) {
    .register-card {
        padding-bottom: 58px; /* extra space for footer */
    }
    .register-footer {
        overflow: visible;
        word-break: break-word; /* allow long words to wrap if needed */
        line-height: 1.6;       /* improve spacing */
    }
    .register-footer a {
        display: inline-block;  /* prevent clipping */
        white-space: nowrap;    /* keep "Connexion" on one line */
    }
}

/* ===== PREMIUM MOBILE REGISTER FIX ===== */
@media (max-width: 819px) {
    .register-right {
        align-items: flex-start;
        padding: 14px 12px 28px;
    }

    .register-card {
        max-width: 100%;
        padding: 24px 18px 42px;
        border-radius: 26px;
        overflow: visible !important;
    }

    .role-switch {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .role-box {
        min-height: 78px;
        padding: 14px 16px;
        border-radius: 20px;
    }

    .role-box i {
        width: 44px;
        height: 44px;
        border-radius: 16px;
    }

    .role-option input:checked + .role-box {
        background: linear-gradient(135deg, #f0fdf4, #ffffff);
        border-color: rgba(22, 163, 74, 0.75);
        box-shadow: 0 12px 28px rgba(22, 163, 74, 0.14);
    }

    .register-footer {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
        overflow: visible !important;
        padding-bottom: 10px;
        line-height: 1.6;
    }

    .register-footer a {
        display: inline-flex;
        white-space: nowrap;
        color: var(--green-dark);
        font-weight: 900;
    }
}


.register-form input::placeholder,
.register-form textarea::placeholder {
    color: rgba(107, 114, 128, 0.45);
    font-weight: 300;
    letter-spacing: 0.01em;
}
/* Premium validation */

.form-field {
    position: relative;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 4px rgba(220,38,38,.08) !important;
}

.form-field.has-error label {
    color: #dc2626 !important;
}

.form-field.has-success input,
.form-field.has-success select,
.form-field.has-success textarea {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 4px rgba(22,163,74,.08) !important;
}

.field-error-message {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #dc2626;
    line-height: 1.4;
}

.field-success-message {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #16a34a;
    line-height: 1.4;
}


/* Technician category dynamic field */
.technician-category-row {
    transition: all .22s ease;
}

.technician-category-row.is-hidden {
    display: none !important;
}

.form-field.has-error select#category_id {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .08) !important;
}
