.sc-auth-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--sc-text);
    background: var(--sc-page-bg);
}

.sc-auth-page *,
.sc-auth-page *::before,
.sc-auth-page *::after {
    box-sizing: border-box;
}

.sc-auth-page button,
.sc-auth-page input,
.sc-auth-page select,
.sc-auth-page textarea {
    font: inherit;
}

.sc-auth-frame {
    width: min(1040px, calc(100% - 40px));
    min-height: calc(100vh - 40px);
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg);
    background: var(--sc-surface);
    box-shadow: var(--sc-shadow-panel);
}

.sc-auth-header {
    min-height: 72px;
    padding: var(--sc-space-3) var(--sc-space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-space-4);
    border-bottom: 1px solid var(--sc-border);
}

.sc-auth-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--sc-space-3);
    color: var(--sc-heading);
    text-decoration: none;
}

.sc-auth-brand:hover {
    color: var(--sc-heading);
}

.sc-auth-brand__logo {
    width: 42px;
    height: 42px;
    padding: 5px;
    flex: 0 0 auto;
    object-fit: contain;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    background: var(--sc-surface);
}

.sc-auth-brand strong,
.sc-auth-brand small {
    display: block;
}

.sc-auth-brand strong {
    font-size: 17px;
    line-height: 22px;
    font-weight: 700;
}

.sc-auth-brand small {
    margin-top: 1px;
    color: var(--sc-text-muted);
    font-size: 12px;
    line-height: 16px;
}

.sc-auth-header__action {
    min-height: 40px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sc-border-strong);
    border-radius: var(--sc-radius);
    color: var(--sc-heading);
    background: var(--sc-surface);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    text-decoration: none;
}

.sc-auth-header__action:hover {
    color: var(--sc-primary);
    background: var(--sc-surface-subtle);
}

.sc-auth-main {
    width: 100%;
    flex: 1 1 auto;
    padding: var(--sc-space-8);
}

.sc-auth-footer {
    min-height: 52px;
    padding: var(--sc-space-3) var(--sc-space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sc-space-2);
    border-top: 1px solid var(--sc-border);
    color: var(--sc-text-muted);
    background: var(--sc-surface-subtle);
    font-size: 12px;
    line-height: 18px;
}

.sc-auth-card {
    width: min(470px, 100%);
    margin: 0 auto;
    padding: var(--sc-space-8);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg);
    background: var(--sc-surface);
    box-shadow: var(--sc-shadow-panel);
}

.sc-auth-card--registration {
    width: min(860px, 100%);
}

.sc-auth-heading {
    margin-bottom: var(--sc-space-6);
}

.sc-auth-eyebrow {
    margin: 0 0 var(--sc-space-1);
    color: var(--sc-primary);
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sc-auth-heading h1 {
    margin: 0;
    color: var(--sc-heading);
    font-size: 28px;
    line-height: 34px;
    font-weight: 700;
}

.sc-auth-heading p {
    margin: var(--sc-space-2) 0 0;
    color: var(--sc-text-muted);
    font-size: 14px;
    line-height: 21px;
}

.sc-auth-alert {
    margin-bottom: var(--sc-space-5);
}

.sc-auth-alert strong {
    display: block;
    margin-bottom: var(--sc-space-1);
}

.sc-auth-alert p {
    margin: 0;
}

.sc-auth-alert ul {
    margin: var(--sc-space-2) 0 0;
    padding-left: var(--sc-space-5);
}

.sc-auth-alert li + li {
    margin-top: var(--sc-space-1);
}

.sc-auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-5);
}

.sc-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sc-auth-label {
    color: var(--sc-text);
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.sc-auth-required {
    color: var(--sc-danger);
}

.sc-auth-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--sc-border-strong);
    border-radius: var(--sc-radius);
    color: var(--sc-text);
    background: var(--sc-surface);
    font-size: 15px;
    line-height: 22px;
}

.sc-auth-control::placeholder {
    color: #8694a5;
}

.sc-auth-control:hover {
    border-color: #9fadb9;
}

.sc-auth-control:focus {
    border-color: var(--sc-primary);
    outline: 0;
    box-shadow: var(--sc-focus-ring);
}

.sc-auth-control[aria-invalid="true"] {
    border-color: var(--sc-danger);
}

textarea.sc-auth-control {
    min-height: 92px;
    resize: vertical;
}

.sc-auth-password {
    position: relative;
}

.sc-auth-password .sc-auth-control {
    padding-right: 66px;
}

.sc-auth-password__toggle {
    min-width: 52px;
    min-height: 36px;
    padding: 6px 9px;
    position: absolute;
    top: 4px;
    right: 4px;
    border: 0;
    border-radius: var(--sc-radius-sm);
    color: var(--sc-primary);
    background: transparent;
    font-size: 13px;
    line-height: 18px;
    font-weight: 700;
    cursor: pointer;
}

.sc-auth-password__toggle:hover {
    background: var(--sc-info-bg);
}

.sc-auth-help,
.sc-auth-error {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
}

.sc-auth-help {
    color: var(--sc-text-muted);
}

.sc-auth-help.is-valid {
    color: var(--sc-success);
}

.sc-auth-help.is-invalid,
.sc-auth-error {
    color: var(--sc-danger);
}

.sc-auth-submit {
    width: 100%;
    min-height: 44px;
}

.sc-auth-secondary {
    padding-top: var(--sc-space-5);
    margin-top: var(--sc-space-5);
    border-top: 1px solid var(--sc-border);
    text-align: center;
}

.sc-auth-secondary p {
    margin: 0 0 var(--sc-space-3);
    color: var(--sc-text-muted);
    font-size: 13px;
    line-height: 18px;
}

.sc-auth-secondary .sc-button {
    width: 100%;
}

.sc-auth-note {
    margin-top: var(--sc-space-5);
    padding: var(--sc-space-3) var(--sc-space-4);
    border: 1px solid var(--sc-border);
    border-left: 3px solid var(--sc-primary);
    border-radius: var(--sc-radius);
    color: var(--sc-text-muted);
    background: var(--sc-surface-subtle);
    font-size: 13px;
    line-height: 19px;
}

.sc-auth-note strong {
    display: block;
    margin-bottom: 2px;
    color: var(--sc-heading);
}

.sc-auth-section {
    padding: var(--sc-space-5);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg);
    background: var(--sc-surface);
}

.sc-auth-section[hidden] {
    display: none;
}

.sc-auth-section__header {
    margin-bottom: var(--sc-space-4);
    padding-bottom: var(--sc-space-3);
    border-bottom: 1px solid var(--sc-border);
}

.sc-auth-section__header h2 {
    margin: 0;
    color: var(--sc-heading);
    font-size: 17px;
    line-height: 23px;
    font-weight: 700;
}

.sc-auth-section__header p {
    margin: var(--sc-space-1) 0 0;
    color: var(--sc-text-muted);
    font-size: 13px;
    line-height: 19px;
}

.sc-auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sc-space-4);
}

.sc-auth-grid__full {
    grid-column: 1 / -1;
}

.sc-auth-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-space-3);
}

.sc-auth-form-actions .sc-button {
    min-width: 180px;
}

.sc-auth-status {
    width: min(560px, 100%);
    margin: min(12vh, 100px) auto;
    padding: var(--sc-space-8);
    border: 1px solid var(--sc-border);
    border-top: 3px solid var(--sc-primary);
    border-radius: var(--sc-radius-lg);
    background: var(--sc-surface);
    text-align: center;
    box-shadow: var(--sc-shadow-panel);
}

.sc-auth-status__code {
    margin: 0 0 var(--sc-space-2);
    color: var(--sc-primary);
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
    letter-spacing: .08em;
}

.sc-auth-status h1 {
    margin: 0;
    color: var(--sc-heading);
    font-size: 28px;
    line-height: 34px;
}

.sc-auth-status__message {
    max-width: 440px;
    margin: var(--sc-space-3) auto 0;
    color: var(--sc-text-muted);
    font-size: 15px;
    line-height: 22px;
}

.sc-auth-status__actions {
    margin-top: var(--sc-space-6);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sc-space-3);
}

@media (max-width: 767px) {
    .sc-auth-frame {
        width: min(100% - 24px, 1040px);
        min-height: calc(100vh - 24px);
        margin: 12px auto;
    }

    .sc-auth-header,
    .sc-auth-main,
    .sc-auth-footer {
        padding-left: var(--sc-space-4);
        padding-right: var(--sc-space-4);
    }

    .sc-auth-main {
        padding-top: var(--sc-space-5);
        padding-bottom: var(--sc-space-5);
    }

    .sc-auth-card,
    .sc-auth-status {
        padding: var(--sc-space-5);
    }

    .sc-auth-grid {
        grid-template-columns: 1fr;
    }

    .sc-auth-grid__full {
        grid-column: auto;
    }

    .sc-auth-form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .sc-auth-form-actions .sc-button {
        width: 100%;
    }

    .sc-auth-status {
        margin: var(--sc-space-8) auto;
    }
}

@media (max-width: 479px) {
    .sc-auth-frame {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .sc-auth-header {
        min-height: 64px;
    }

    .sc-auth-brand__logo {
        width: 38px;
        height: 38px;
    }

    .sc-auth-brand small {
        display: none;
    }

    .sc-auth-header__action {
        min-height: 44px;
    }

    .sc-auth-card,
    .sc-auth-status {
        padding: var(--sc-space-4);
        border-radius: var(--sc-radius);
        box-shadow: none;
    }

    .sc-auth-heading h1,
    .sc-auth-status h1 {
        font-size: 24px;
        line-height: 30px;
    }

    .sc-auth-footer {
        font-size: 12px;
    }
}
