/* Patient registration page. Uses the shared theme variables; no fixed colours. */
.registration-page {
    min-height: 100vh;
    background: var(--app-bg, var(--app-surface));
}

.registration-main {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem;
}

.registration-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.registration-logo {
    max-height: 90px;
    width: auto;
}

/* Stepper: centred series of numbered steps joined by a line. */
.registration-steps {
    display: flex;
    justify-content: center;
    width: min(640px, 100%);
    margin: 0 auto 1.75rem;
    padding: 0;
    list-style: none;
}

.registration-step {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    color: var(--app-muted);
    font-size: .875rem;
    text-align: center;
}

/* The line to the previous step. */
.registration-step + .registration-step::before {
    content: "";
    position: absolute;
    top: 1.125rem;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--app-border);
}

.registration-step.is-done + .registration-step::before,
.registration-step.is-active::before {
    background: var(--ds-success);
}

.registration-step-number {
    position: relative;
    z-index: 1;
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 2px solid var(--app-border);
    border-radius: 50%;
    color: var(--app-muted);
    background: var(--app-surface);
    font-weight: 600;
}

.registration-step.is-active {
    color: var(--app-ink);
    font-weight: 600;
}

.registration-step.is-active .registration-step-number {
    border-color: var(--app-primary);
    color: #fff; /* text on the primary colour */
    background: var(--app-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-primary) 20%, transparent);
}

.registration-step.is-done {
    color: var(--app-ink);
}

.registration-step.is-done .registration-step-number {
    border-color: var(--ds-success);
    color: #fff; /* text on the success colour */
    background: var(--ds-success);
    font-size: 0;
}

.registration-step.is-done .registration-step-number::before {
    content: "\f633"; /* bi-check-lg */
    font-family: bootstrap-icons;
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 575.98px) {
    .registration-step {
        font-size: .75rem;
    }
}

/* Groups of fields inside a step. */
.form-section {
    min-width: 0;
    margin: 0 0 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: var(--ds-radius-md);
}

.form-section-title {
    float: none;
    width: auto;
    margin: 0 0 1rem;
    padding: 0;
    color: var(--app-ink);
    font-size: 1rem;
    font-weight: 600;
}

.form-section-title i {
    margin-right: .5rem;
    color: var(--app-primary);
}

.photo-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

#photoPreview {
    width: 200px;
    height: 200px;
    max-width: 100%;
    object-fit: cover;
    border: 2px solid var(--app-border);
    border-radius: var(--ds-radius-md);
}

.camera-panel video {
    display: block;
    width: 100%;
    max-height: 60vh;
    border-radius: var(--ds-radius-md);
    background: #000; /* camera preview stays black */
}

.consent-text {
    max-height: 420px;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: var(--ds-radius-md);
    text-align: justify;
}

.signature-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100px;
    padding: .5rem;
    border: 1px solid var(--app-border);
    border-radius: var(--ds-radius-md);
    color: var(--app-ink);
    background: var(--app-surface);
    cursor: pointer;
}

.signature-box.is-static {
    cursor: default;
}

.signature-box.is-invalid {
    border-color: var(--ds-danger);
}

.signature-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.signature-pad {
    display: block;
    width: 100%;
    border: 1px dashed var(--app-border);
    border-radius: var(--ds-radius-md);
    background: #fff; /* drawing pad stays white with dark ink */
    touch-action: none;
}

.patient-results {
    position: absolute;
    z-index: 5;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: var(--ds-elevation-2);
}
