.studio-system {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: var(--studio-space-6);
    background: var(--studio-canvas);
}

.system-shell {
    display: grid;
    width: min(100%, 720px);
    gap: var(--studio-space-4);
}

.system-main {
    width: 100%;
}

.system-card {
    width: min(100%, 520px);
    margin-inline: auto;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid var(--studio-border);
    border-radius: var(--studio-radius-surface);
    background: var(--studio-surface);
    box-shadow: var(--studio-shadow-raised);
}

.system-card::before {
    content: "Arbor";
    display: block;
    margin-bottom: var(--studio-space-6);
    color: var(--studio-accent);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.system-card h1 {
    margin-bottom: var(--studio-space-3);
    font-size: clamp(1.75rem, 6vw, 2.25rem);
}

.system-card > p {
    color: var(--studio-text-secondary);
}

.login-password-toggle:focus-visible {
    outline: 3px solid var(--studio-focus-light);
    outline-offset: -3px;
}

.system-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--studio-space-4);
    color: var(--studio-text-secondary);
    font-size: .82rem;
    text-align: center;
}

.system-footer a {
    color: inherit;
}

.terms-card {
    width: 100%;
}

.terms-card > header {
    margin-bottom: var(--studio-space-6);
}

.terms-card > header p {
    margin: 0;
    color: var(--studio-text-secondary);
}

.terms-document {
    color: var(--studio-text-secondary);
    line-height: 1.7;
}

.terms-document h1,
.terms-document h2,
.terms-document h3 {
    color: var(--studio-text);
}

.terms-document h2 {
    margin: var(--studio-space-6) 0 var(--studio-space-2);
    font-size: 1.15rem;
}

.terms-document h3 {
    margin: var(--studio-space-5) 0 var(--studio-space-2);
    font-size: 1rem;
}

.terms-document ul {
    margin: 0 0 var(--studio-space-4);
    padding-left: var(--studio-space-6);
}

.terms-document p {
    margin: 0 0 var(--studio-space-4);
}

.terms-document .cookie-policy-table {
    margin: var(--studio-space-6) 0;
    table-layout: fixed;
}

.terms-document .cookie-policy-table th,
.terms-document .cookie-policy-table td {
    padding: var(--studio-space-3);
    overflow-wrap: anywhere;
    vertical-align: top;
}

.terms-document .cookie-policy-table th[scope="rowgroup"] {
    background: var(--studio-border);
}

.cookie-policy-document a {
    overflow-wrap: anywhere;
}

.terms-card form {
    margin-top: var(--studio-space-6);
    padding-top: var(--studio-space-5);
    border-top: 1px solid var(--studio-border);
}

.terms-card form p {
    margin: 0 0 var(--studio-space-4);
    color: var(--studio-text-secondary);
}

.terms-actions {
    margin-top: var(--studio-space-6);
    padding-top: var(--studio-space-5);
    border-top: 1px solid var(--studio-border);
}

.tenant-choice-list {
    display: grid;
    gap: var(--studio-space-3);
    margin: var(--studio-space-6) 0;
}

.tenant-choice {
    display: flex;
    align-items: center;
    gap: var(--studio-space-4);
    padding: var(--studio-space-4);
    border: 1px solid var(--studio-border);
    border-radius: var(--studio-radius-panel);
    background: var(--studio-surface);
}

.tenant-choice__details {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: var(--studio-space-1);
}

.tenant-choice__details strong,
.tenant-choice__details small {
    overflow-wrap: anywhere;
}

.tenant-choice__details small {
    color: var(--studio-text-secondary);
}

.tenant-choice__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--studio-space-2);
    margin-top: var(--studio-space-3);
}

.tenant-choice__action {
    min-height: 44px;
    padding: var(--studio-space-2) var(--studio-space-4);
    border: 0;
    border-radius: var(--studio-radius-control);
    background: var(--studio-accent);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}

.tenant-choice-new {
    width: 100%;
    margin-top: var(--studio-space-2);
}

.invitation-summary {
    margin: var(--studio-space-5) 0 var(--studio-space-6);
    padding: var(--studio-space-4);
    border-radius: var(--studio-radius-panel);
    background: var(--studio-surface-subtle);
}

.invitation-summary > p {
    margin: 0;
}

.invitation-actions {
    padding-top: var(--studio-space-2);
}

.invitation-actions > p {
    margin-bottom: var(--studio-space-5);
    color: var(--studio-text-secondary);
}

.invitation-decline {
    margin-top: var(--studio-space-4);
}

.system-card .invitation-decline > button[type="submit"] {
    border: 1px solid var(--studio-border-strong);
    background: transparent;
    color: var(--studio-text);
}

.system-card form > .btn[type="submit"] {
    width: 100%;
}

.system-card form > .system-link-action[type="submit"] {
    display: inline;
    min-height: 0;
    width: auto;
    padding: 0;
    background: transparent;
    color: var(--studio-focus-light);
    font-weight: inherit;
    text-decoration: underline;
    text-underline-offset: .18em;
}

.system-card form > .system-link-action[type="submit"]:hover {
    background: transparent;
    color: var(--studio-accent-hover);
}

.verification-login-link {
    margin: var(--studio-space-6) 0 0;
}

.system-card form + form {
    margin-top: var(--studio-space-3);
}

.system-card .tenant-choice > .tenant-choice__action {
    width: auto;
    flex: 0 0 auto;
}

.system-card .invitation-decline > button[type="submit"]:hover {
    background: var(--studio-surface-subtle);
    color: var(--studio-text);
}

.login-account {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--studio-space-4);
    margin: var(--studio-space-6) 0;
    padding: var(--studio-space-5);
    border: 1px solid var(--studio-border);
    border-radius: var(--studio-radius-panel);
    background: var(--studio-surface-subtle);
}

.login-account__icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--studio-info-bg);
    color: var(--studio-accent);
}

.login-account__icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.login-account__details {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.login-account__details strong,
.login-account__details > span:last-child {
    overflow-wrap: anywhere;
}

.login-account__details strong {
    font-size: 1.05rem;
}

.login-account__details > span:last-child {
    color: var(--studio-text-secondary);
    font-size: .88rem;
}

.login-account__status {
    display: inline-flex;
    align-items: center;
    gap: var(--studio-space-2);
    color: var(--studio-success);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.login-account__status > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.login-account__actions {
    display: grid;
    gap: var(--studio-space-3);
}

.login-account__continue {
    width: 100%;
}

.login-account__actions .login-account-switch {
    margin: 0;
}

.system-card .login-account-switch > .btn-secondary {
    border: 1px solid var(--studio-border-strong);
    background: var(--studio-surface);
    color: var(--studio-text);
}

.system-card .login-account-switch > .btn-secondary:hover {
    background: var(--studio-surface-subtle);
    color: var(--studio-text);
}

.signup-box {
    width: 100%;
}

.login-link {
    margin: var(--studio-space-4) 0 0;
    text-align: center;
}

@media (max-width: 480px) {
    .studio-system {
        align-items: start;
        padding: var(--studio-space-4);
    }

    .system-card {
        box-shadow: none;
    }

    .tenant-choice {
        align-items: stretch;
        flex-direction: column;
    }

    .system-card .tenant-choice > .tenant-choice__action {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .system-card * {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
