/* Register page - styles autonomes (sans style.css) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #0f172a;
    color: #334155;
}

.register-page {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 80px;
}
.register-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(0,122,61,0.2) 0%, transparent 50%),
        linear-gradient(225deg, rgba(206,17,38,0.1) 0%, transparent 50%),
        linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,122,61,0.15) 100%),
        url('https://images.unsplash.com/photo-1587854692152-cbe660dbde88?w=1920') center/cover no-repeat;
    z-index: 0;
}
.register-page::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,122,61,0.2) 100%);
    z-index: 0;
}

.register-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 880px;
}

.lang-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.95);
    padding: 6px 10px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
html[dir="ltr"] .lang-switch { right: 16px; left: auto; }
html[dir="rtl"] .lang-switch { right: 16px; left: auto; }
.lang-switch button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.2s;
}
.lang-switch button.active {
    background: #007A3D;
    color: white;
}
.lang-switch button:hover:not(.active) {
    background: #f1f5f9;
    color: #007A3D;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.back-link:hover { opacity: 0.9; }

.register-header {
    text-align: center;
    margin-bottom: 24px;
}
.register-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #007A3D, #059669);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 8px 32px rgba(0,122,61,0.4);
}
.register-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    margin-bottom: 6px;
}
.register-header p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.plan-badge,
.pharmacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.95);
    padding: 14px 22px;
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    border: 2px solid rgba(0,122,61,0.3);
}
.pharmacy-badge .icon,
.plan-badge .icon { font-size: 2.2rem; }
.pharmacy-badge .name,
.plan-badge .name { font-weight: 700; font-size: 1.1rem; color: #007A3D; }
.pharmacy-badge .price,
.plan-badge .price { font-size: 0.9rem; color: #64748b; }
.store-badge .name { color: #1e40af; }
.clinic-badge .name { color: #0369a1; }
.lab-badge .name { color: #7c3aed; }
.imaging-badge .name { color: #0d9488; }

/* Formulaire - 2 colonnes côte à côte, alignées en haut */
.register-form {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 28px 32px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.5);
}

.form-blocks {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 36px;
    align-items: flex-start;
}
.form-block {
    flex: 1 1 240px;
    min-width: 0;
    max-width: calc(50% - 18px);
}
/* LTR: Admin gauche (order 1), Facility droite (order 2) */
html[dir="ltr"] .form-block-admin { order: 1; }
html[dir="ltr"] .form-block-pharmacy,
html[dir="ltr"] .form-block-facility { order: 2; }
/* RTL: Facility droite (order 1), Admin gauche (order 2) */
html[dir="rtl"] .form-block-pharmacy,
html[dir="rtl"] .form-block-facility { order: 1; }
html[dir="rtl"] .form-block-admin { order: 2; }

@media (max-width: 540px) {
    .form-blocks {
        flex-direction: column;
        gap: 28px;
    }
    .form-block { flex: 1 1 auto; max-width: none; }
}

.form-block h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #007A3D;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0,122,61,0.2);
}
.form-block .form-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.form-block label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}
html[dir="rtl"] .form-block label { text-align: right; }
html[dir="ltr"] .form-block label { text-align: left; }
.form-block input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.2s;
}
.form-block input:focus {
    outline: none;
    border-color: #007A3D;
}

.form-actions {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    flex: 1 1 100%;
    width: 100%;
    order: 3;
}
.form-actions button {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, #007A3D, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,122,61,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.form-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,122,61,0.5);
}
.form-actions button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.form-errors {
    padding: 14px 18px;
    background: rgba(254,226,226,0.98);
    border-radius: 12px;
    margin-bottom: 20px;
    color: #b91c1c;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid #fca5a5;
}
.form-error-icon { margin-inline-end: 8px; }
.form-block input.field-error {
    border-color: #dc2626;
    background: rgba(254,226,226,0.3);
}
.field-error-hint {
    display: block;
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 4px;
}

.success-msg {
    padding: 24px;
    background: rgba(220,252,231,0.95);
    border-radius: 16px;
    margin-top: 20px;
    color: #166534;
    font-weight: 600;
    border: 2px solid #86efac;
}
.success-msg a { color: #007A3D; font-weight: 700; text-decoration: underline; }
