/* ==========================================================================
   Sign-in, team management and invitations
   ========================================================================== */

.login-page {
    max-width: 1200px;
}

.login-main {
    max-width: 620px;
    margin: 0 auto;
}

.login-preview {
    margin: 24px auto 0;
    max-width: 440px;
}

/* Stacked under the sign-in panel by default, including on phones. */
.login-preview .phone-frame {
    width: min(300px, 100%);
    margin: 0 auto;
}

/* From this width the form and the phone sit side by side instead of
   stacked, centered together as one block. */
@media (min-width: 1300px) {
    .login-layout {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        gap: 32px;
    }

    .login-main {
        flex: 0 0 620px;
        margin: 0;
    }

    .login-preview {
        flex: 0 0 440px;
        margin: 0;
    }

    .login-preview .phone-frame {
        width: 440px;
        margin: 0;
    }
}

/* A plain dark rounded rectangle standing in for a phone bezel - the
   video itself is already cropped to exactly the device's screen
   content (no real bezel/notch in the source recording), so this is
   just enough chrome to read as "a phone" without faking hardware
   details the recording doesn't have. */
.phone-frame {
    width: 440px;
    aspect-ratio: 376 / 812;
    background: #111;
    border-radius: 34px;
    padding: 10px;
    box-shadow: 0 12px 30px -8px rgba(17, 24, 39, 0.35);
}

.phone-frame-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    display: block;
    background: #000;
}

.login-preview-caption {
    text-align: center;
    margin-top: 12px;
    font-weight: 600;
    color: var(--gray-700);
}

.login-preview-beta {
    margin-top: 4px;
}

.login-preview-beta a {
    text-decoration: underline;
}

.account-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.type-option {
    cursor: pointer;
}

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

.type-option span {
    display: block;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.type-option span strong {
    display: block;
    font-size: 1em;
    margin-bottom: 3px;
}

.type-option span em {
    display: block;
    font-style: normal;
    font-size: 0.82em;
    color: var(--gray-500);
}

.type-option:hover span {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.type-option input:checked + span {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.type-option input:focus-visible + span {
    outline: 2px solid var(--gray-900);
    outline-offset: 2px;
}

/* Preview credentials */
.demo-box {
    margin-top: 26px;
    padding: 16px 18px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius);
}

.demo-box h3 {
    font-size: 0.86em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.demo-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.85em;
}

.demo-table th {
    text-align: left;
    color: var(--gray-500);
    font-weight: 600;
    padding: 4px 8px 4px 0;
}

.demo-table td {
    padding: 4px 8px 4px 0;
}

.demo-table code {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 1px 6px;
}

/* Team page */
.team-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.panel-title {
    font-size: 1.05em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-pill {
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 0.72em;
    font-weight: 600;
}

.roster {
    list-style: none;
    margin-bottom: 22px;
}

.roster-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.88em;
}

.roster-name { font-weight: 600; }
.roster-title { color: var(--gray-500); }

.roster-email {
    margin-left: auto;
    color: var(--gray-500);
    font-size: 0.9em;
}

.badge {
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.74em;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge.admin    { background: var(--primary-color); color: white; }
.badge.pending  { background: #fef3c7; color: #92400e; }
.badge.accepted { background: #d1fae5; color: #047857; }
.badge.expired  { background: #fee2e2; color: #b91c1c; }

.invite-note {
    margin-top: 14px;
}

.invite-link-row {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.invite-link-row input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82em;
    background: white;
}

@media (max-width: 860px) {
    .team-layout,
    .account-type {
        grid-template-columns: 1fr;
    }
}

/* Roster row controls */
.roster-handle {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.86em;
    color: var(--primary-color);
    background: var(--brand-cream);
    border-radius: 4px;
    padding: 1px 6px;
}

.roster-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.roster-by {
    color: var(--gray-500);
    font-size: 0.9em;
}

.row-btn {
    padding: 4px 10px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.row-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.row-btn.danger:hover:not(:disabled) {
    border-color: var(--danger-color);
    background: var(--danger-color);
    color: white;
}

.row-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.badge.you {
    background: var(--brand-brown);
    color: white;
}

.panel-divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 24px 0 20px;
}

.add-form {
    margin-top: 4px;
}

/* The business picker on the login form - actually hidden for a groomer
   login (login.js toggles this class), not just visually de-emphasized. */
.business-choice {
    margin-bottom: 18px;
}

.business-choice select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    background: white;
}

.business-choice.hidden {
    display: none;
}
