:root {
    --primary: #0a8eb1;
    --primary-dark: #086883;
    --bg-page: #ecfafe;
    --bg-card: #ffffff;
    --border-color: #e3e8ef;
    --text-primary: #2d3848;
    --text-secondary: #47556b;
    --text-muted: #7a8599;
    --danger: #b42318;
    --danger-dark: #8a1a13;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(145deg, #f7fdff 0%, var(--bg-page) 65%, #d6f8ff 100%);
    color: var(--text-primary);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(260px, 420px) minmax(320px, 480px);
    justify-content: center;
    align-content: center;
    align-items: stretch;
    gap: 1.5rem;
    padding: 2rem;
}

.brand-panel,
.card-panel {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: 0 20px 40px rgba(45, 56, 72, 0.08);
}

.brand-panel {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
}

.brand-panel h1 {
    margin: 0;
    font-size: 1.75rem;
}

.brand-panel p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.link-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 600;
}

.card-panel {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
}

.auth-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.25rem;
}

.auth-content.auth-content-centered {
    justify-content: center;
}

.auth-actions {
    margin-top: auto;
    display: grid;
    gap: 0.7rem;
}

.auth-actions form {
    margin: 0;
}

.auth-content.auth-content-centered .auth-actions {
    margin-top: 0.4rem;
}

.message-list {
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.message {
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    font-size: 0.92rem;
    border: 1px solid transparent;
}

.message.error {
    background: #fef3f2;
    color: var(--danger);
    border-color: #fecdca;
}

.message.success {
    background: #ecfdf3;
    color: #067647;
    border-color: #abefc6;
}

.card-header h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.35rem;
}

.card-header p {
    margin: 0 0 1rem 0;
    color: var(--text-muted);
}

.inline-alert {
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
}

.inline-alert.error {
    background: #fef3f2;
    color: var(--danger);
    border: 1px solid #fecdca;
}

.primary-btn {
    appearance: none;
    width: 100%;
    border: 0;
    border-radius: 11px;
    padding: 0.75rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.provider-btn {
    width: 100%;
    border-radius: 11px;
    padding: 0.72rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-primary);
}

.provider-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(10, 142, 177, 0.12);
}

.provider-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
}

.provider-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.provider-label {
    display: block;
    width: 100%;
    text-align: center;
}

.primary-btn.danger {
    background: linear-gradient(145deg, var(--danger), var(--danger-dark));
}

.helper-text {
    margin: 0.85rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.secondary-link {
    display: inline-flex;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .brand-panel {
        order: 2;
    }

    .card-panel {
        order: 1;
    }
}
