/* ==========================================================================
   Registration hub and forms
   ========================================================================== */

.page.narrow {
    max-width: 780px;
}

/* Hub */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.hub-card {
    display: block;
    padding: 26px 22px;
    background: white;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px -1px rgba(17, 24, 39, 0.1),
                0 10px 20px -5px rgba(17, 24, 39, 0.12);
    text-decoration: none;
    color: var(--gray-900);
    transition: var(--transition);
}

.hub-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.hub-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}

.hub-card h2 {
    font-size: 1.2em;
    margin-bottom: 6px;
}

.hub-card p {
    color: var(--gray-700);
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 12px;
}

.hub-count {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 0.78em;
    font-weight: 600;
}

/* Forms */
.reg-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* An author rule always beats the UA stylesheet's own [hidden] rule at
   equal specificity, so the plain display:grid above would otherwise win
   even while hidden is set - toggling a .reg-form's hidden attribute
   needs this to actually disappear. */
.reg-form[hidden] {
    display: none;
}

.reg-form > .wide,
.reg-form > fieldset.wide {
    grid-column: 1 / -1;
}

.reg-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--gray-700);
}

.reg-form label em {
    color: var(--danger-color);
    font-style: normal;
}

.reg-form input,
.reg-form select,
.reg-form textarea {
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    background: white;
}

.reg-form input:focus,
.reg-form select:focus,
.reg-form textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -1px;
    border-color: var(--primary-color);
}

.reg-form textarea {
    resize: vertical;
}

/* Only relevant while "+ New client" is picked in the pet parent select. */
.reg-form.owner-picked .new-client-field {
    display: none;
}

.reg-form label.checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 9px;
    align-self: end;
    padding-bottom: 10px;
}

.reg-form label.checkbox-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.field-note {
    font-size: 0.82em;
    font-weight: 500;
    color: var(--gray-500);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

/* Buttons and links sit side by side in the action row */
.form-actions .btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* Coat colour picker */
.coat-picker {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 14px;
}

.coat-picker legend {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--gray-700);
    padding: 0 6px;
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.avatar-option {
    text-align: center;
    cursor: pointer;
    padding: 8px 4px;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: var(--transition);
}

.avatar-option:hover {
    background: var(--gray-50);
}

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

.avatar-option img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 6px;
    background: var(--gray-100);
}

.avatar-option span {
    font-size: 0.76em;
    font-weight: 500;
    color: var(--gray-700);
    display: block;
}

.avatar-option:has(input:checked) {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.avatar-option:has(input:focus-visible) {
    outline: 2px solid var(--gray-900);
    outline-offset: 1px;
}

/* Result panel */
.reg-result {
    margin-top: 22px;
    padding: 18px 20px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--border-radius);
}

.reg-result.hidden {
    display: none;
}

.reg-result h3 {
    font-size: 1.02em;
    color: #047857;
    margin-bottom: 12px;
}

.reg-result dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 14px;
    font-size: 0.86em;
    margin-bottom: 10px;
}

.reg-result dt {
    color: var(--gray-500);
    font-weight: 600;
    text-transform: capitalize;
}

.reg-result dd {
    color: var(--gray-900);
    word-break: break-word;
}

@media (max-width: 700px) {
    .reg-form {
        grid-template-columns: 1fr;
    }
}

/* Shown instead of the owner dropdown when a parent adds their own pet */
.owner-locked {
    padding: 12px 14px;
    background: var(--brand-cream);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--gray-700);
}

/* Invitation banner on the groomer/parent registration forms - and the
   "you need one" state when there isn't one. */
.invite-banner {
    padding: 14px 16px;
    margin-bottom: 20px;
    background: #eef2ff;
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.5;
}

.invite-banner.invalid {
    background: #fef2f2;
    border-left-color: var(--danger-color);
}

/* The lone Back link shown in place of the form when there's nothing to
   fill in (e.g. no invitation). Block-level so it doesn't run up against
   the banner above it. */
.panel > a.btn {
    display: inline-block;
    margin-top: 4px;
}
