.auth-layout {
    min-height: calc(100vh - 140px);
    padding: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 6vw, 6rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(520px, 100%);
    background: var(--auth-card-surface);
    border: 1px solid var(--glass-fill);
    border-radius: 32px;
    padding: clamp(1.75rem, 4vw, 3rem);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.auth-card--wide {
    width: min(820px, 100%);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: -40% auto auto -35%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, var(--accent-glow), var(--clear-fill) 70%);
    opacity: 0.7;
    pointer-events: none;
}

.auth-card::after {
    content: "";
    position: absolute;
    inset: auto -40% -45% auto;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, var(--support-glow), var(--clear-fill) 70%);
    opacity: 0.6;
    pointer-events: none;
}

.auth-card > * {
    position: relative;
    z-index: 2;
}

.auth-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent-top), var(--accent-end-soft));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--copy-on-accent);
    box-shadow: 0 12px 30px var(--accent-raise);
    margin-bottom: 1rem;
}

.auth-icon--logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: none;
    box-shadow: none;
    padding: 0;
    border: none;
    overflow: hidden;
}

.auth-icon--logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.auth-title {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    margin: 0 0 0.4rem;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-card form .form-group {
    margin-bottom: 0;
}

.auth-birthday-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr);
    gap: 0.75rem;
}

.auth-errors,
.auth-field-error {
    color: var(--copy-alert-muted);
    font-size: 0.92rem;
}

.auth-errors p,
.auth-field-error {
    margin: 0.4rem 0 0;
}

.auth-card form label {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.auth-card form input,
.auth-card form select,
.auth-card form textarea,
.auth-card form .form-control {
    width: 100%;
    background: var(--glass-soft);
    border: 1px solid var(--glass-fill);
    border-radius: 18px;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-card form input:focus,
.auth-card form select:focus,
.auth-card form textarea:focus,
.auth-card form .form-control:focus {
    outline: none;
    border-color: var(--accent-ring-gentle);
    background: var(--glass-fill);
    box-shadow: 0 0 0 3px var(--accent-halo);
}

@media (max-width: 640px) {
    .auth-birthday-grid {
        grid-template-columns: 1fr;
    }
}

.btn-gradient,
.auth-card form button {
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end-soft) 60%, var(--accent-end-warm));
    color: var(--copy-on-accent);
    box-shadow: 0 20px 40px var(--accent-shadow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-gradient:hover,
.auth-card form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 25px 50px var(--accent-shadow-strong);
}

.auth-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.auth-meta a,
.auth-link {
    color: var(--support-base);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.auth-meta a:hover,
.auth-link:hover {
    color: var(--support-focus);
}

.auth-meta a:focus-visible,
.auth-link:focus-visible {
    outline: 2px solid var(--support-focus);
    outline-offset: 3px;
    border-radius: 6px;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    opacity: 1;
    transition: color 0.2s ease;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-fill);
    flex-wrap: wrap;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid var(--glass-hold);
    box-shadow: 0 20px 50px var(--shadow-mid);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar--editor {
    width: 148px;
    height: 148px;
    border-radius: 32px;
    margin-bottom: 1rem;
}

.profile-meta h2 {
    margin: 0;
    font-size: 1.5rem;
}

.profile-meta p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
}

.profile-editor {
    gap: 1.5rem;
}

.profile-editor__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.profile-panel {
    background: var(--glass-soft);
    border: 1px solid var(--glass-fill);
    border-radius: 24px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.profile-panel--full {
    grid-column: 1 / -1;
}

.profile-panel__header h3 {
    margin: 0.5rem 0 0.35rem;
    font-size: 1.15rem;
}

.profile-panel__header p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.profile-editor__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.profile-editor__columns--media {
    align-items: start;
}

.profile-field {
    min-width: 0;
}

.profile-toggle-list {
    display: grid;
    gap: 0.85rem;
}

.profile-toggle-list--with-help {
    gap: 0.55rem;
}

.profile-toggle-list .publish-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    width: fit-content;
}

.profile-toggle-list .publish-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.profile-toggle-list .publish-toggle__ui {
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-press);
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease;
    flex: 0 0 auto;
}

.profile-toggle-list .publish-toggle__ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--copy-strong);
    box-shadow: 0 10px 18px var(--shadow-mid);
    transition: transform 0.15s ease, background 0.15s ease;
}

.profile-toggle-list .publish-toggle input:checked + .publish-toggle__ui {
    background: var(--accent-wash-hot);
    border-color: var(--accent-shadow-strong);
}

.profile-toggle-list .publish-toggle input:checked + .publish-toggle__ui::after {
    transform: translateX(18px);
    background: var(--editor-note-surface);
}

.profile-toggle-list .publish-toggle input:focus-visible + .publish-toggle__ui {
    outline: 2px solid var(--accent-ring-gentle);
    outline-offset: 3px;
}

.profile-toggle-list .publish-toggle__label {
    color: var(--copy-peak);
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0;
}

.publish-toggle.is-saving {
    opacity: 0.7;
}

.profile-settings-divider {
    width: 100%;
    height: 1px;
    background: var(--header-divider);
}

.profile-field--avatar input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-field__help {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.profile-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    background: var(--glass-fill);
    border: 1px solid var(--glass-strong);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.profile-upload-label:hover {
    background: var(--glass-strong);
    border-color: var(--accent-glow);
}

.auth-card .info-paragraph {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.auth-validation {
    display: none;
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    background: var(--danger-surface);
    border: 1px solid var(--danger-edge);
    color: var(--copy-alert-warm);
    font-weight: 500;
    margin-bottom: 1rem;
}

.auth-validation.is-visible {
    display: block;
}

.auth-validation--stable {
    display: block;
    min-height: 3.8rem;
    visibility: hidden;
    opacity: 0;
    background: transparent;
    border-color: transparent;
    transition: opacity 0.15s ease;
}

.auth-validation--stable.is-visible {
    visibility: visible;
    opacity: 1;
    background: var(--danger-surface);
    border-color: var(--danger-edge);
}

@media (max-width: 640px) {
    .auth-layout {
        padding: clamp(1.5rem, 7vw, 2.5rem) clamp(0.75rem, 5vw, 1.25rem);
    }

    .auth-card {
        border-radius: 24px;
    }

    .profile-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-editor__grid,
    .profile-editor__columns {
        grid-template-columns: 1fr;
    }
}
