:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --border: #dbe4f0;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #0050E0;
    --accent-dark: #1f3f86;
    --accent-soft: #eef5ff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Source Sans Pro", Arial, sans-serif;
    background: linear-gradient(180deg, #f4f7fb 0%, #edf3fb 100%);
    color: var(--text);
}

body {
    padding: 28px 16px;
}

.register-page {
    max-width: 1180px;
    margin: 0 auto;
}

.register-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(31, 63, 134, 0.08);
    overflow: hidden;
}

.register-header {
    text-align: center;
    padding: 34px 24px 24px;
    border-bottom: 1px solid #edf2f9;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.logo-wrap {
    margin-bottom: 14px;
}

.logo {
    width: 180px;
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.register-header h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    color: var(--accent-dark);
}

.register-subtitle {
    margin: 10px auto 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.info-message,
.error-message {
    margin: 18px 24px 0;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
}

.info-message {
    background: #eef5ff;
    color: #1f3f86;
    border: 1px solid #cfe0ff;
}

.error-message {
    background: #fff1f2;
    color: #b42318;
    border: 1px solid #ffd5d9;
}

.form-grid--2cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 24px;
}

.field--full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.field textarea,
.field select,
.field input:not([type="checkbox"]) {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: all .15s ease;
}

.field textarea {
    min-height: 96px;
    resize: vertical;
}

.field textarea:focus,
.field select:focus,
.field input:focus {
    border-color: #c7d8ff;
    box-shadow: 0 0 0 3px rgba(31, 79, 138, 0.10);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 54px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #3b4b66;
    transition: .15s ease;
}

.toggle-password:hover {
    background: #f7faff;
    border-color: #cfe0ff;
}

.password-rules {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.password-rule {
    font-size: 13px;
    color: #888;
    transition: color 0.2s ease;
}

.password-rule::before {
    content: "• ";
}

.password-rule.is-valid {
    color: #1a7f37;
    font-weight: 600;
}

.password-rule.is-valid::before {
    content: "✓ ";
}

.password-rule.is-invalid {
    color: #888;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 24px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.checkbox-grid--single {
    grid-template-columns: 1fr;
}

.field .checkbox-item {
    display: grid !important;
    grid-template-columns: 18px 1fr;
    align-items: start !important;
    column-gap: 12px;
    margin: 0;
    cursor: pointer;
}

.field .checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 3px 0 0 0;
    accent-color: var(--accent);
}

.field .checkbox-item span {
    display: block;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.file-input-wrap {
    width: 100%;
}

.file-input-wrap input[type="file"] {
    width: 100%;
    min-height: 44px;
    padding: 5px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    box-sizing: border-box;
}

.file-input-wrap input[type="file"]::file-selector-button {
    height: 32px;
    padding: 0 12px;
    margin-right: 12px;
    border-radius: 10px;
    border: 1px solid #d7dde5;
    background: #eef2f6;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-dark);
    cursor: pointer;
}

.file-input-wrap input[type="file"]::file-selector-button:hover {
    background: #e4e9f1;
}

.field small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.specialite-block {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbff;
    margin-bottom: 14px;
}

.specialite-block__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.specialite-block__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-dark);
}

.specialites-actions {
    margin-top: 10px;
}

.required {
    color: #d93025;
    font-weight: 700;
}

.form-note-wrap {
    padding: 0 24px 10px;
}

.form-note {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.btn-primary,
.btn-ghost,
.btn-remove-specialite,
.btn-link {
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: .15s ease;
}

.btn-primary:hover {
    filter: brightness(.95);
}

.btn-ghost {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s ease;
}

.btn-ghost:hover {
    background: #f3f6fb;
    border-color: #d6e0f5;
}

.btn-remove-specialite {
    background: #fff1f2;
    color: #b42318;
    border: 1px solid #ffd5d9;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s ease;
}

.btn-remove-specialite:hover:not(:disabled) {
    background: #ffe4e8;
}

.btn-remove-specialite:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 24px 28px;
}

@media (max-width: 900px) {

    .form-grid--2cols,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        padding: 14px;
    }

    .register-header {
        padding: 26px 18px 20px;
    }

    .register-header h1 {
        font-size: 24px;
    }

    .form-grid--2cols {
        padding: 18px;
    }

    .form-note-wrap,
    .form-actions {
        padding-left: 18px;
        padding-right: 18px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-ghost {
        width: 100%;
        text-align: center;
    }

    .logo {
        width: 150px;
    }
}

.checkbox-item input[type="checkbox"]:focus {
    outline: none;
    box-shadow: none;
}

.checkbox-item input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: none;
}