/* myPA Connect — auth / authorize screens */

.auth-body {
    font-family: var(--font, "Manrope", system-ui, sans-serif);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    color: var(--ink, #0B1220);
    background: #07111f;
}

.auth-body .animated-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-body .mesh-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.auth-body .gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    animation: authFloat 22s ease-in-out infinite;
}

.auth-body .gradient-orb-1 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #1e3a8a 0%, transparent 70%);
    top: -180px;
    left: -160px;
}

.auth-body .gradient-orb-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #2563eb 0%, transparent 70%);
    bottom: -140px;
    right: -120px;
    animation-delay: -7s;
}

.auth-body .gradient-orb-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #334155 0%, transparent 70%);
    top: 42%;
    left: 48%;
    animation-delay: -14s;
}

@keyframes authFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -36px) scale(1.08); }
    66% { transform: translate(-28px, 24px) scale(0.94); }
}

.auth-lang {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
}

.auth-lang select {
    padding: 8px 32px 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232563EB' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.auth-card,
.login-container,
.authorize-card,
.error-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: authCardIn 0.5s ease both;
}

.authorize-card,
.error-card {
    max-width: 480px;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand,
.logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand img,
.logo img {
    max-width: 168px;
    height: auto;
    margin-bottom: 10px;
}

.auth-brand .brand-name {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e3a8a;
    letter-spacing: -0.02em;
}

.auth-brand p,
.logo p {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 4px;
}

.auth-card .form-group {
    margin-bottom: 16px;
}

.auth-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
}

.auth-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    background: #f8fafc;
}

.auth-card input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #fff;
}

.auth-card .btn,
.authorize-card .btn,
.error-card .btn {
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-card .btn-primary,
.authorize-card .btn-authorize,
.auth-card .btn {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.auth-card .btn:hover,
.authorize-card .btn-authorize:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.4);
}

.authorize-card .btn-deny,
.error-card .btn-secondary {
    background: #f1f5f9;
    color: #334155;
    margin-top: 10px;
}

.auth-card .message.success {
    background: #ecfdf5;
    color: #065f46;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    border-left: 3px solid #059669;
    font-size: 0.9rem;
}

.auth-error,
.error {
    background: #fef2f2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    border-left: 3px solid #dc2626;
    font-size: 0.9rem;
}

.auth-footer,
.footer {
    text-align: center;
    margin-top: 20px;
    color: #64748b;
    font-size: 0.875rem;
}

.auth-footer a,
.footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover,
.footer a:hover {
    text-decoration: underline;
}

.caps-lock-hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #b45309;
}

/* Authorize */
.session-bar {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    text-align: center;
}

.session-bar a {
    color: #2563eb;
    font-weight: 600;
}

.app-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f1f5f9;
    border-radius: 14px;
    margin-bottom: 20px;
}

.app-strip img,
.app-strip .app-fallback {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.app-strip .app-fallback {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.app-strip h2 {
    font-size: 1.1rem;
    color: #0b1220;
    margin-bottom: 2px;
}

.app-strip .url {
    font-size: 0.8rem;
    color: #64748b;
    word-break: break-all;
}

.permissions-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 12px;
}

.permissions-list {
    list-style: none;
    margin-bottom: 24px;
}

.permissions-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    color: #334155;
    font-size: 0.9rem;
}

.permissions-list li::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 50%;
    background: #2563eb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    animation: errorPulse 1.8s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.error-card h2 {
    text-align: center;
    color: #1e3a8a;
    margin-bottom: 10px;
    font-family: "Source Serif 4", Georgia, serif;
}

.error-card p {
    text-align: center;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.55;
}

@media (max-width: 480px) {
    .auth-body {
        padding: 16px;
    }

    .auth-card,
    .login-container,
    .authorize-card,
    .error-card {
        padding: 28px 20px;
    }

    .auth-lang {
        top: 12px;
        right: 12px;
    }
}
